Commit 13aa9e94 authored by nanahira's avatar nanahira Committed by GitHub

Add an error handling on http.request

This will prevent the http request here throwing out errors.
parent 7f8b702f
...@@ -125,6 +125,11 @@ Client.prototype.makeRequest = function(obj) { ...@@ -125,6 +125,11 @@ Client.prototype.makeRequest = function(obj) {
callback(null, resData); //no error, so no err object callback(null, resData); //no error, so no err object
}); });
}); });
req.on('error', (e) => {
callback(e, null);
});
req.end(); req.end();
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment