Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Pass through to the next 'connect' layer on an ENOENT error (i.e. req…

…uested file does not exist).

This matches the behavior of the 'staticProvider' middleware in 'connect', and will also prevent unnecessary errors being spewed to the server's stderr, when it should really only respond with a 404.
  • Loading branch information...
commit 40e8d379fea9e1bc6dd4c30173f7b4ce762e6860 1 parent bb34cff
@TooTallNate TooTallNate authored committed
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/wheat.js
5 lib/wheat.js
@@ -36,8 +36,9 @@ function addRoute(regex, renderer) {
function handleRoute(req, res, next, renderer, match) {
function callback(err, data) {
if (err) {
- next(err);
- return;
+ return err.errno === process.ENOENT
+ ? next()
+ : next(err);
res.writeHead(200, data.headers);
Please sign in to comment.
Something went wrong with that request. Please try again.