Skip to content

Instantly share code, notes, and snippets.

@mikevalstar
Created January 18, 2012 15:56
Show Gist options
  • Save mikevalstar/1633706 to your computer and use it in GitHub Desktop.
Save mikevalstar/1633706 to your computer and use it in GitHub Desktop.
App.js changed for tutorial project
var error = require('./lib/ErrorHandler');
app.configure('development', function(){
//app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
app.use(error({ showMessage: true, dumpExceptions: true, showStack: true, logErrors: __dirname + '/log/error_log' }));
});
app.configure('production', function(){
//app.use(express.errorHandler());
app.use(error());
});
/* ... */
// Example error pages
app.get('/ErrorExample', function(req, res, next){
next(new Error('keyboard cat!')); // trigger an error
});
app.get('/ErrorExample2', function(req, res){
res.render('404.jade'); // force an error.. we did not set the title
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment