mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
check err in health check and null check res
This commit is contained in:
parent
7185657f06
commit
a964119b5e
1 changed files with 4 additions and 1 deletions
|
@ -25,7 +25,10 @@ module.exports =
|
|||
opts = getOpts()
|
||||
opts.json = true
|
||||
request.get opts, (err, res, body)->
|
||||
if res.statusCode != 200
|
||||
if err?
|
||||
logger.err err:err, "docstore returned a error in health check get"
|
||||
cb(err)
|
||||
else if res?.statusCode != 200
|
||||
cb("status code not 200, its #{res.statusCode}")
|
||||
else if _.isEqual(body.lines, lines) and body._id == doc_id.toString()
|
||||
cb()
|
||||
|
|
Loading…
Reference in a new issue