Skip to content

Commit

Permalink
Keep request on error status
Browse files Browse the repository at this point in the history
  • Loading branch information
geek committed Mar 22, 2017
1 parent 92e65dc commit 83e0f2b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,14 +215,14 @@ internals.Client.prototype.request = function (method, url, options, callback, _

const finish = (err, res) => {

if (!err && res.statusCode >= 400) {
err = Boom.create(res.statusCode, res.statusMessage);
}

if (err) {
req.abort();
}

if (!err && res.statusCode >= 400) {
err = Boom.create(res.statusCode, res.statusMessage);
}

req.removeListener('response', onResponse);
req.removeListener('error', onError);
req.on('error', Hoek.ignore);
Expand Down

0 comments on commit 83e0f2b

Please sign in to comment.