Permalink
Browse files

add some comments to error-pages example

  • Loading branch information...
1 parent f2d7bbe commit f7c1c638bbe79aa9dd3e8e329af164dbe06859c1 @tj tj committed Aug 28, 2012
Showing with 7 additions and 2 deletions.
  1. +5 −0 examples/error-pages/index.js
  2. +2 −2 examples/error-pages/views/index.jade
@@ -76,16 +76,21 @@ app.get('/', function(req, res){
});
app.get('/404', function(req, res, next){
+ // trigger a 404 since no other middleware
+ // will match /404 after this one, and we're not
+ // responding here
next();
});
app.get('/403', function(req, res, next){
+ // trigger a 403 error
var err = new Error('not allowed!');
err.status = 403;
next(err);
});
app.get('/500', function(req, res, next){
+ // trigger a generic (500) error
next(new Error('keyboard cat!'));
});
@@ -8,8 +8,8 @@ block content
| visit
a(href="/500") 500
li
- | visit
+ | visit
a(href="/404") 404
li
- | visit
+ | visit
a(href='/403') 403

0 comments on commit f7c1c63

Please sign in to comment.