Permalink
Browse files

clean up error example

  • Loading branch information...
1 parent c17ad6e commit 13c18fa3638ea8bb3456d4656632ab48cf9d58d7 @tj tj committed Apr 26, 2012
Showing with 4 additions and 5 deletions.
  1. +4 −5 examples/error/app.js
View
9 examples/error/app.js
@@ -4,10 +4,10 @@
*/
var express = require('../../')
- , app = module.exports = express();
+ , app = module.exports = express()
+ , test = app.get('env') == 'test';
-if ('test' != process.env.NODE_ENV)
- app.use(express.logger('dev'));
+if (!test) app.use(express.logger('dev'));
app.use(app.router);
// the error handler is strategically
@@ -24,8 +24,7 @@ app.use(error);
function error(err, req, res, next) {
// log it
- if ('test' != process.env.NODE_ENV)
- console.error(err.stack);
+ if (!test) console.error(err.stack);
// respond with 500 "Internal Server Error".
res.send(500);

0 comments on commit 13c18fa

Please sign in to comment.