Browse Source

Don't report full errors in API results.

middleware/500.js
	-Return a generic error message rather than stringified error
	object in API results.
pull/116/head
Severyn Kozak 10 years ago
parent
commit
cf1a483ede
  1. 2
      middleware/500.js

2
middleware/500.js

@ -6,7 +6,7 @@ function middleware(err, req, res, next) {
logger.error( 'Stack trace:', err.trace );
res.header('Cache-Control','no-cache');
if( res.statusCode < 400 ){ res.status(500); }
res.json({ error: err.toString() });
res.json({ error: 'internal server error' });
}
module.exports = middleware;

Loading…
Cancel
Save