Skip to content

Commit

Permalink
chore: log request exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
avwo committed Nov 19, 2019
1 parent 8950441 commit c27b3c8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/util/http-mgr.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,12 @@ function updateBody(url, callback, init) {
var code = res.statusCode;
if (code == 404) {
err = body = '';
logger.warn('[Load Rules]', url, 'status', 404);
} else if (!err && code != 200 && code != 204) {
err = new Error('Response ' + code);
err = 'response ' + code;
}
if (err) {
logger.error(url, err.message);
logger.error('[Load Rules]', url, err.message || err);
if (init) {
updateBody(url);
return;
Expand Down

0 comments on commit c27b3c8

Please sign in to comment.