Permalink
Browse files

added error handler

  • Loading branch information...
1 parent 3726c96 commit 0736dac50bf0cc946d5330b1f1ac99487da968a4 @mafintosh committed May 26, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 index.js
View
@@ -5,7 +5,7 @@ var METHODS = ['get', 'post', 'put', 'del' , 'delete', 'head', 'options']
var HTTP_METHODS = ['GET', 'POST', 'PUT', 'DELETE', 'DELETE', 'HEAD', 'OPTIONS'];
var noop = function() {};
-var notFound = function(res) {
+var error = function(res) {
return function() {
res.statusCode = 404;
res.end();
@@ -26,7 +26,7 @@ var router = function() {
var url = index === -1 ? req.url : req.url.substr(0, index);
var i = 0;
- next = next || notFound(res);
+ next = next || error(res);
if (!method) return next();
var loop = function(err) {

0 comments on commit 0736dac

Please sign in to comment.