add missing err check

This commit is contained in:
Henry Oswald 2016-06-01 14:34:23 +01:00
parent 3cae036c3c
commit f81d40d573

View file

@ -25,7 +25,10 @@ module.exports =
opts = getOpts("/") opts = getOpts("/")
opts.json = true opts.json = true
request.get opts, (err, res, body)-> request.get opts, (err, res, body)->
if res.statusCode != 200 if err?
logger.err err:err, "Health Check: error getting notification"
return callback(err)
else if res.statusCode != 200
e = "status code not 200 #{res.statusCode}" e = "status code not 200 #{res.statusCode}"
logger.err err:err, e logger.err err:err, e
return cb(e) return cb(e)