Browse Source

typeof error should be string

pull/163/head
Harish Krishna 10 years ago
parent
commit
8e17f28170
  1. 2
      middleware/408.js

2
middleware/408.js

@ -6,7 +6,7 @@ function middleware(err, req, res, next) {
if( res.statusCode === 408 || (error.toLowerCase().indexOf('request timeout') !== -1) ){ if( res.statusCode === 408 || (error.toLowerCase().indexOf('request timeout') !== -1) ){
res.status(408); res.status(408);
res.json({ error: error === 'string' ? error : 'request time out' }); res.json({ error: typeof error === 'string' ? error : 'request time out' });
} else { } else {
next(err); next(err);
} }

Loading…
Cancel
Save