DC-130 rev3: log.error on unexpected bridge status in /status + test asserting the log call (13 tests green)
This commit is contained in:
@@ -136,7 +136,12 @@ module.exports = function ({ asyncHandler, log, auditLogger, fetchT }) {
|
||||
}
|
||||
if (status !== 200) {
|
||||
// malformed upstream route or other unexpected bridge failure
|
||||
return errorResponse(res, 502, body && body.error ? body.error : 'unexpected bridge response');
|
||||
log.error('deploys', 'status probe: unexpected bridge response', {
|
||||
service,
|
||||
status,
|
||||
bridgeError: body && body.error ? String(body.error).slice(0, 200) : 'none',
|
||||
});
|
||||
return errorResponse(res, 502, 'shipdeck bridge protocol error (unexpected response, status ' + status + ')');
|
||||
}
|
||||
return ok(res, { ok: body.ok === true, output: body.output || '' });
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user