You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cvm/src/errors.js

20 lines
462 B
JavaScript

'use strict';
const errorChain = require("error-chain");
let HttpError = errorChain.create("HttpError", {
context: { exposeToUser: true }
});
module.exports = {
UnauthorizedError: errorChain.create("UnauthorizedError", {
inheritsFrom: HttpError,
context: { statusCode: 401 }
}),
ForbiddenError: errorChain.create("ForbiddenError", {
inheritsFrom: HttpError,
context: { statusCode: 403 }
}),
HardwareError: errorChain.create("HardwareError"),
};