Don't hang request in the event of a spelling backend error

This commit is contained in:
James Allen 2016-05-24 15:11:14 +01:00
parent 3452a9870e
commit 36ba88297b

View file

@ -12,4 +12,5 @@ module.exports = SpellingController =
request(url: Settings.apis.spelling.url + url, method: req.method, headers: req.headers, json: req.body, timeout:TEN_SECONDS) request(url: Settings.apis.spelling.url + url, method: req.method, headers: req.headers, json: req.body, timeout:TEN_SECONDS)
.on "error", (error) -> .on "error", (error) ->
logger.error err: error, "Spelling API error" logger.error err: error, "Spelling API error"
res.status(500).end()
.pipe(res) .pipe(res)