Permalink
Browse files

if not found, return 404

  • Loading branch information...
1 parent b88ffe6 commit 8c5a76aaa0af905dc8ce70e7ed7ab7d8c04d429f @jgallen23 committed Apr 30, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/handler.js
View
@@ -11,7 +11,11 @@ module.exports = function(config) {
throw new Error('must pass in imagePath');
var error = function(res, error) {
- res.statusCode = 500;
+ if (error.message == 'image file not found') {
+ res.statusCode = 404;
+ } else {
+ res.statusCode = 500;
+ }
res.end(error.message);
};

0 comments on commit 8c5a76a

Please sign in to comment.