mirror of https://github.com/pelias/api.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
9 lines
269 B
9 lines
269 B
9 years ago
|
|
||
|
// handle time out errors
|
||
|
function middleware(err, req, res, next) {
|
||
|
res.header('Cache-Control','no-cache');
|
||
|
if( res.statusCode === 408 ){ res.status(408); }
|
||
|
res.json({ error: typeof err === 'string' ? err : 'request time out' });
|
||
|
}
|
||
|
|
||
|
module.exports = middleware;
|