Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F996485
error-to-boom.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
510 B
Referenced Files
None
Subscribers
None
error-to-boom.js
View Options
"use strict"
;
const
Sealious
=
require
(
"../../lib/main"
);
const
Boom
=
require
(
"boom"
);
const
error_code_map
=
{
validation
:
403
,
value_exists
:
409
,
invalid_credentials
:
401
,
not_found
:
404
,
permission
:
401
,
bad_subject
:
404
,
bad_subject_action
:
405
,
field_does_not_support_attachments
:
405
,
};
function
error_to_boom
(
error
)
{
const
code
=
error_code_map
[
error
.
type
];
const
ret
=
Boom
.
create
(
code
,
error
.
message
,
error
);
ret
.
output
.
payload
=
error
;
return
ret
;
}
module
.
exports
=
error_to_boom
;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 24, 14:04 (12 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
557285
Default Alt Text
error-to-boom.js (510 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment