Page MenuHomeSealhub

error-to-boom.js
No OneTemporary

error-to-boom.js

"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

Mime Type
text/plain
Expires
Tue, Dec 24, 14:05 (3 m, 56 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
557285
Default Alt Text
error-to-boom.js (510 B)

Event Timeline