mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 06:33:55 +01:00
Merge pull request #295 from sharelatex/msw-history-failure
Bail out if history API request fails
This commit is contained in:
@@ -46,9 +46,14 @@ module.exports = HistoryController =
|
|||||||
"X-User-Id": user_id
|
"X-User-Id": user_id
|
||||||
}, (error, response, body) ->
|
}, (error, response, body) ->
|
||||||
return next(error) if error?
|
return next(error) if error?
|
||||||
HistoryManager.injectUserDetails body, (error, data) ->
|
if 200 <= res.statusCode < 300
|
||||||
return next(error) if error?
|
HistoryManager.injectUserDetails body, (error, data) ->
|
||||||
res.json 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) ->
|
buildHistoryServiceUrl: (useProjectHistory) ->
|
||||||
# choose a history service, either document-level (trackchanges)
|
# choose a history service, either document-level (trackchanges)
|
||||||
|
|||||||
Reference in New Issue
Block a user