UnauthorizedError.js 422 B

1234567891011121314
  1. function UnauthorizedError (code, error) {
  2. this.name = "UnauthorizedError";
  3. this.message = error.message;
  4. Error.call(this, error.message);
  5. Error.captureStackTrace(this, this.constructor);
  6. this.code = code;
  7. this.status = 401;
  8. this.inner = error;
  9. }
  10. UnauthorizedError.prototype = Object.create(Error.prototype);
  11. UnauthorizedError.prototype.constructor = UnauthorizedError;
  12. module.exports = UnauthorizedError;