We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
When request an invalid address, you may got an error like this:
events.js:72 throw er; // Unhandled 'error' event ^ Error: connect ETIMEDOUT at errnoException (net.js:901:11) at Object.afterConnect [as oncomplete] (net.js:892:19)
And I have no good way to handle it.
Maybe HTTPDigest.prototype.request could return its http.ClientRequest object. Like this:
HTTPDigest.prototype.request
http.ClientRequest
HTTPDigest.prototype.request = function (options, callback) { var self = this; var req = http.request(options, function (res) { self._handleResponse(options, res, callback); }); req.end(); return req; };
And to handle error like this:
var req = digest.request({ ... }, function (res) { ... res.on('error', function (err) { console.log('oh noes'); }); }); req.on('error', function (err) { console.log('request error!'); });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
When request an invalid address, you may got an error like this:
And I have no good way to handle it.
Maybe
HTTPDigest.prototype.request
could return itshttp.ClientRequest
object. Like this:And to handle error like this:
The text was updated successfully, but these errors were encountered: