authenticationerror.js 448 B

1234567891011121314151617181920212223
  1. /**
  2. * `AuthenticationError` error.
  3. *
  4. * @api private
  5. */
  6. function AuthenticationError(message, status) {
  7. Error.call(this);
  8. Error.captureStackTrace(this, arguments.callee);
  9. this.name = 'AuthenticationError';
  10. this.message = message;
  11. this.status = status || 401;
  12. }
  13. /**
  14. * Inherit from `Error`.
  15. */
  16. AuthenticationError.prototype.__proto__ = Error.prototype;
  17. /**
  18. * Expose `AuthenticationError`.
  19. */
  20. module.exports = AuthenticationError;