Permalink
Browse files

Added 404 and 500 testing

  • Loading branch information...
1 parent 9c03ce1 commit 4537e8eb4da52dc87a31651653229e3e63b47e5b @robrighter committed Aug 17, 2010
Showing with 11 additions and 1 deletion.
  1. +11 −1 project/app.js
View
@@ -31,7 +31,7 @@ io.on('connection', function(client){
console.log('Listening on http://0.0.0.0:' + port )
//setup the errors
-app.error(function(err, req, res, next){
+server.error(function(err, req, res, next){
if (err instanceof NotFound) {
res.render('404.ejs');
} else {
@@ -53,4 +53,14 @@ server.get('/', function(req,res){
});
});
+//Test Routes for 404 and 500 errors
+server.get('/404', function(req, res){
+ throw new NotFound;
+});
+
+server.get('/500', function(req, res){
+ throw new Error('keyboard cat!');
+});
+
+

0 comments on commit 4537e8e

Please sign in to comment.