mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
dns: send lookup c-ares errors to callback
Calling dns.lookup with arguments that generate an error from c-ares
previously sent those errors back to the callback. This commit restores
the ca9eb71 behavior.
Fixes #7731.
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Signed-off-by: Fedor Indutny <fedor@indutny.com>
This commit is contained in:
1 parent
a55c60c715
commit
61baefce1e
2 files changed
+49
-1
No files matched your search
+5
-1
@@ -132,8 +132,12 @@ exports.lookup = function(hostname, family, callback) {
|
||||
hostname: hostname,
|
||||
oncomplete: onlookup
|
||||
};
|
||||
|
||||
var err = cares.getaddrinfo(req, hostname, family);
|
||||
if (err) throw errnoException(err, 'getaddrinfo', hostname);
|
||||
if (err) {
|
||||
callback(errnoException(err, 'getaddrinfo', hostname));
|
||||
return {};
|
||||
}
|
||||
|
||||
callback.immediately = true;
|
||||
return req;
|
||||
|
||||
Reference in new issue
Block a user