Cleanup error messages for jobs that fail to start .

This commit is contained in:
John-David Dalton
2014-06-22 20:48:38 -07:00
parent 6b09cd61d2
commit 8465e3061a

View File

@@ -384,8 +384,12 @@ function onJobStart(error, res, body) {
this.restart();
return;
}
var na = 'unavailable',
bodyStr = _.isObject(body) ? '\n' + JSON.stringify(body) : na,
statusStr = _.isFinite(statusCode) ? statusCode : na;
logInline();
console.error('Failed to start job; status: %d, body:\n%s', statusCode, JSON.stringify(body));
console.error('Failed to start job; status: %s, body: %s', statusStr, bodyStr);
if (error) {
console.error(error);
}
@@ -470,7 +474,7 @@ function onJobStatus(error, res, body) {
}
else {
if (typeof message == 'undefined') {
message = 'no results available. ' + details;
message = 'Results are unavailable. ' + details;
}
console.error(label, description, chalk.red('failed') + ';', message);
}