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.
19 lines
421 B
JavaScript
19 lines
421 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 }
|
|
}, HttpError),
|
|
};
|