From a964119b5ef9f8b3bb3f87b5b4de2c7fd8bdf681 Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Tue, 1 Dec 2015 21:50:18 +0000 Subject: [PATCH] check err in health check and null check res --- services/docstore/app/coffee/HealthChecker.coffee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/docstore/app/coffee/HealthChecker.coffee b/services/docstore/app/coffee/HealthChecker.coffee index aa3ef60108..3818afc822 100644 --- a/services/docstore/app/coffee/HealthChecker.coffee +++ b/services/docstore/app/coffee/HealthChecker.coffee @@ -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()