diff --git a/lib/adapters/http.js b/lib/adapters/http.js index 3c3970a..8e4558a 100644 --- a/lib/adapters/http.js +++ b/lib/adapters/http.js @@ -103,6 +103,11 @@ module.exports = function httpAdapter(resolve, reject, config) { } }); + stream.on('error', function handleStreamError(err) { + if (aborted) return; + reject(err); + }); + stream.on('end', function handleStreamEnd() { var d = Buffer.concat(responseBuffer); if (config.responseType !== 'arraybuffer') {