Skip to content

Commit

Permalink
added error handler
Browse files Browse the repository at this point in the history
  • Loading branch information
mafintosh committed May 26, 2012
1 parent 3726c96 commit 0736dac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Expand Up @@ -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();
Expand All @@ -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) {
Expand Down

0 comments on commit 0736dac

Please sign in to comment.