Skip to content

Commit

Permalink
fix: display monitor error code in the error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantin Yegupov committed May 7, 2019
1 parent d3901bb commit e19969d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/monitor.ts
Expand Up @@ -97,7 +97,8 @@ export function monitor(root, meta, info: SingleDepRootResult): Promise<any> {
if (res.statusCode === 200 || res.statusCode === 201) {
resolve(body);
} else {
const e = new MonitorError('unexpected error: ' + body.message);
const e = new MonitorError('Server returned unexpected error for the monitor request. ' +
`Status code: ${res.statusCode}, response: ${res.body.userMessage || res.body.message}`);
e.code = res.statusCode;
e.userMessage = body && body.userMessage;
if (!e.userMessage && res.statusCode === 504) {
Expand Down

0 comments on commit e19969d

Please sign in to comment.