mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-30 19:50:48 +00:00
Bail out if history API request fails
This commit is contained in:
parent
3ac4e4c457
commit
9303969d7b
1 changed files with 8 additions and 3 deletions
|
@ -46,9 +46,14 @@ module.exports = HistoryController =
|
|||
"X-User-Id": user_id
|
||||
}, (error, response, body) ->
|
||||
return next(error) if error?
|
||||
HistoryManager.injectUserDetails body, (error, data) ->
|
||||
return next(error) if error?
|
||||
res.json data
|
||||
if 200 <= res.statusCode < 300
|
||||
HistoryManager.injectUserDetails body, (error, data) ->
|
||||
return next(error) if error?
|
||||
res.json data
|
||||
else
|
||||
error = new Error("history api responded with non-success code: #{res.statusCode}")
|
||||
logger.error err: error, user_id: user_id, "error proxying request to history api"
|
||||
next(error)
|
||||
|
||||
buildHistoryServiceUrl: (useProjectHistory) ->
|
||||
# choose a history service, either document-level (trackchanges)
|
||||
|
|
Loading…
Reference in a new issue