removed use of app.error() in examples

This commit is contained in:
Tj Holowaychuk 2011-07-11 11:13:07 -07:00
parent 456a985666
commit 297ae6fdb4
3 changed files with 3 additions and 4 deletions

View File

@ -38,7 +38,7 @@ app.get('/files/:file(*)', function(req, res, next){
});
});
app.error(function(err, req, res, next){
app.use(function(err, req, res, next){
if ('ENOENT' == err.code) {
res.send('Cant find that file, sorry!');
} else {

View File

@ -23,8 +23,7 @@ function bootApplication(app) {
app.use(express.static(__dirname + '/public'));
// Example 500 page
app.error(function(err, req, res){
console.dir(err)
app.use(function(err, req, res, next){
res.render('500');
});

View File

@ -40,7 +40,7 @@ function andRestrictToSelf(req, res, next) {
} else {
// You may want to implement specific exceptions
// such as UnauthorizedError or similar so that you
// can handle these in app.error() specifically
// can handle these can be special-cased in an error handler
// (view ./examples/pages for this)
next(new Error('Unauthorized'));
}