Skip to content

Commit

Permalink
Add AccessTokenError.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhanson committed Aug 14, 2013
1 parent 5fa7ed1 commit 7771ee6
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions lib/errors/accesstokenerror.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* `AccessTokenError` error.
*
* AccessTokenError represents an error in response to an access token request.
* For details, refer to RFC 6749, section 5.2.
*
* References:
* - [The OAuth 2.0 Authorization Framework](http://tools.ietf.org/html/rfc6749)
*
* @constructor
* @param {String} [message]
* @param {String} [code]
* @param {String} [uri]
* @param {Number} [status]
* @api public
*/
function AccessTokenError(message, code, uri, status) {
Error.call(this);
Error.captureStackTrace(this, arguments.callee);
this.name = 'AccessTokenError';
this.message = message;
this.code = code || 'invalid_request';
this.uri = uri;
this.status = status || 500;
}

/**
* Inherit from `Error`.
*/
AccessTokenError.prototype.__proto__ = Error.prototype;


/**
* Expose `AccessTokenError`.
*/
module.exports = AccessTokenError;

0 comments on commit 7771ee6

Please sign in to comment.