mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-01 13:22:15 -05:00
send 503 unavailable response on EPIPE
This commit is contained in:
parent
8464ce33a1
commit
f239fc3b5d
1 changed files with 3 additions and 0 deletions
|
@ -230,6 +230,9 @@ app.use(function(error, req, res, next) {
|
||||||
if (error instanceof Errors.NotFoundError) {
|
if (error instanceof Errors.NotFoundError) {
|
||||||
logger.warn({ err: error, url: req.url }, 'not found error')
|
logger.warn({ err: error, url: req.url }, 'not found error')
|
||||||
return res.sendStatus(404)
|
return res.sendStatus(404)
|
||||||
|
} else if (error.code === 'EPIPE') {
|
||||||
|
// inspect container returns EPIPE when shutting down
|
||||||
|
return res.sendStatus(503) // send 503 Unavailable response
|
||||||
} else {
|
} else {
|
||||||
logger.error({ err: error, url: req.url }, 'server error')
|
logger.error({ err: error, url: req.url }, 'server error')
|
||||||
return res.sendStatus((error != null ? error.statusCode : undefined) || 500)
|
return res.sendStatus((error != null ? error.statusCode : undefined) || 500)
|
||||||
|
|
Loading…
Reference in a new issue