2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-20 20:00:40 +03:00

capture errors on request data streams

This commit is contained in:
Justin Beckwith
2018-03-15 22:12:42 -07:00
parent 9a6abd789f
commit c65065ac0f
2 changed files with 18 additions and 1 deletions
+3 -1
View File
@@ -233,7 +233,9 @@ module.exports = function httpAdapter(config) {
// Send the request
if (utils.isStream(data)) {
data.pipe(req);
data.on('error', function handleStreamError(err) {
reject(enhanceError(err, config, null, req));
}).pipe(req);
} else {
req.end(data);
}