Permalink
Browse files

Added Forbidden error

  • Loading branch information...
1 parent 2d2630c commit bb0336831a32d2a165bf74f43137115d479e9171 @corpix committed Dec 28, 2011
Showing with 11 additions and 1 deletion.
  1. +10 −0 index.js
  2. +1 −1 package.json
View
@@ -9,11 +9,21 @@ function NotFound(){
Error.captureStackTrace(this, arguments.callee);
}
+function Forbidden(){
+ this.name = 'Forbidden';
+ this.status = 403;
+ this.message = 'Forbidden. You don\'t have permission to access this';
+
+ Error.call(this, this.message);
+ Error.captureStackTrace(this, arguments.callee);
+}
+
////
// Error types comming here ->
//
ex._NotFound = NotFound;
+ex._Forbidden = Forbidden;
for(var i in ex){
ex[i].prototype.__proto__ = Error.prototype;
View
@@ -2,7 +2,7 @@
"author": "Corpix <me@corpix.ru> (http://corpix.ru)",
"name": "express-errors",
"description": "Error handler",
- "version": "0.0.3",
+ "version": "0.0.4",
"repository": {
"type": "git",
"url": "git://github.com/corpix/express-errors.git"

0 comments on commit bb03368

Please sign in to comment.