Skip to content

Commit

Permalink
Add additional logging in case of _postBulkAPI request exeption
Browse files Browse the repository at this point in the history
  • Loading branch information
egorvas committed Dec 15, 2023
1 parent e35add5 commit f0600b2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion MonitorClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -592,12 +592,13 @@ class MonitorClient extends EventEmitter {
try {
json = e.response.data ? e.response.data : JSON.parse(e.response.body);
} catch (jsonException) {
// do nothing
this.log(`Impossible to parse JSON body: ${e.response.body}`);
}
if (json && json.error) {
this.log(`Monitor API Error [code ${json.error.code}]: ${json.error.message}`);
}
}
this.log(e);
throw new Error(`${url} POST ${errorMessages.request_failed} ${e.message}`);
}
return result;
Expand Down

0 comments on commit f0600b2

Please sign in to comment.