Merge pull request #181 from overleaf/bg-fix-503-response

handle EPIPE errors in CompileController
This commit is contained in:
Brian Gough 2020-06-22 09:30:35 +01:00 committed by GitHub
commit 2b342c6e53

View file

@ -55,6 +55,10 @@ module.exports = CompileController = {
} else if (error instanceof Errors.FilesOutOfSyncError) {
code = 409 // Http 409 Conflict
status = 'retry'
} else if (error && error.code === 'EPIPE') {
// docker returns EPIPE when shutting down
code = 503 // send 503 Unavailable response
status = 'unavailable'
} else if (error != null ? error.terminated : undefined) {
status = 'terminated'
} else if (error != null ? error.validate : undefined) {