authenticationerror.js 438 B

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