Skip to content
Snippets Groups Projects
Commit b2ec9af1 authored by Lloyd Hilaiel's avatar Lloyd Hilaiel
Browse files

rework __heartbeat__ log message - heartbeat failure is a .warn(), not an...

rework __heartbeat__ log message - heartbeat failure is a .warn(), not an error().  the latter indicates an unexpected condition that should never happen in production.  thought here is that the dependee that's failing should have errors() in her log message, and the depener should have warnings.  Also, this gets error messages out of the console output of the unit test.
parent 726b4f36
No related branches found
No related tags found
No related merge requests found
......@@ -52,8 +52,8 @@ exports.setup = function(app, options, cb) {
ok(false, e);
}
} else {
logger.error("Not all dependencies are available");
ok(false, '\n' + notOk.join('\n') + '\n');
logger.warn("heartbeat failed due to dependencies - " + notOk.join(', '));
ok(false, '\n' + notOk.join('\n') + '\n');
}
}
};
......@@ -104,13 +104,14 @@ var check = exports.check = function(url, cb) {
clearTimeout(timeoutHandle);
if (res.statusCode === 200) cb(true);
else {
logger.error("non-200 response from " + shortname + ". fatal! (" + res.statusCode + ")");
logger.warn("heartbeat failure: non-200 response from " + shortname + ". fatal! (" +
res.statusCode + ")");
cb(false, "response code " + res.statusCode);
}
});
req.on('error', function (e) {
clearTimeout(timeoutHandle);
logger.error("can't communicate with " + shortname + ". fatal: " + e);
logger.warn("heartbeat failure: can't communicate with " + shortname + ". fatal: " + e);
cb(false, e);
});
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment