mirror of
https://github.com/tenrok/axios.git
synced 2026-05-15 11:59:42 +03:00
Adding error handling to request for node.js - closes #18
This commit is contained in:
@@ -76,6 +76,11 @@ module.exports = function httpAdapter(resolve, reject, config) {
|
||||
});
|
||||
});
|
||||
|
||||
// Handle errors
|
||||
req.on('error', function (err) {
|
||||
reject(err);
|
||||
});
|
||||
|
||||
// Send the request
|
||||
req.end(data);
|
||||
};
|
||||
Reference in New Issue
Block a user