/**
 * Module dependencies
 */

var util = require('util');


/**
 * UnauthorizedError
 */

function UnauthorizedError(options, status) {
  this.name              = 'UnauthorizedError';
  this.error             = options.error;
  this.error_description = options.error_description;
  //this.realm             = options.realm;
  //this.scope             = options.scope;
  this.statusCode        = options.statusCode || 401;
  Error.call(this, this.message);
  Error.captureStackTrace(this, arguments.callee);
}

util.inherits(UnauthorizedError, Error);


/**
 * Error Codes
 */

UnauthorizedError.errorCodes = [
  'invalid_request',
  'invalid_token',
  'insufficient_scope'
];


/**
 * Exports
 */

module.exports = UnauthorizedError;


@@ -275,16 +275,70 @@
 iption;%0A
+  this.message           = options.error_description;%0A
   //this

add message property to UnauthorizedError