Skip to content

Commit

Permalink
Fix(response): doError calls should include options
Browse files Browse the repository at this point in the history
  • Loading branch information
fvdm committed Sep 27, 2017
1 parent e0f7dbb commit f343eac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions requestbin.js
Expand Up @@ -62,20 +62,20 @@ function processResponse (res, err, options, callback) {
var data = res && res.body || null;

if (err) {
doError ('request failed', err, res, callback);
doError ('request failed', err, res, options, callback);
return;
}

if (res && res.statusCode >= 300) {
doError ('HTTP error', null, res, callback);
doError ('HTTP error', null, res, options, callback);
return;
}

try {
data = JSON.parse (data);
callback (null, data);
} catch (e) {
doError ('invalid response', e, res, callback);
doError ('invalid response', e, res, options, callback);
}
}

Expand Down

0 comments on commit f343eac

Please sign in to comment.