From 27913871e11d29b98c40f356779fd792a2eb474f Mon Sep 17 00:00:00 2001 From: Aron Carroll Date: Fri, 22 Jun 2012 15:28:16 +0100 Subject: [PATCH] Add a NotAuthorized error object --- lib/errors.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/errors.js b/lib/errors.js index d1403100..24511e82 100644 --- a/lib/errors.js +++ b/lib/errors.js @@ -22,6 +22,13 @@ NotFound.prototype = Object.create(HTTPError.prototype); module.exports.NotFound = NotFound; +function NotAuthorized(message) { + Error.call(this, 401, message); +} +NotAuthorized.prototype = Object.create(HTTPError.prototype); + +module.exports.NotFound = NotFound; + function BadRequest(message) { HTTPError.call(this, 400, message); }