robb33
3/1/2017 - 12:08 AM

print stacktrace http://stackoverflow.com/questions/16978256/what-is-node-env-in-express

// development error handler
// will print stacktrace
if (app.get('env') === 'development') {
  app.use(function(err, req, res, next) {
    res.status(err.status || 500);
    res.render('error.html', {
      title: '',
      message: err.message,
      error: err,
      app_env: app.get('env'),
      page_class: 'generic page--error'
    });
  });
}