diff options
Diffstat (limited to 'lib/dns.js')
-rw-r--r-- | lib/dns.js | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/lib/dns.js b/lib/dns.js index e9611a3a7..baac2b48d 100644 --- a/lib/dns.js +++ b/lib/dns.js @@ -19,27 +19,12 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -var cares = process.binding('cares_wrap'), - net = require('net'), - isIp = net.isIP; +var cares = process.binding('cares_wrap'); +var net = require('net'); +var util = require('util'); - -function errnoException(errorno, syscall) { - // TODO make this more compatible with ErrnoException from src/node.cc - // Once all of Node is using this function the ErrnoException from - // src/node.cc should be removed. - - // For backwards compatibility. libuv returns ENOENT on NXDOMAIN. - if (errorno == 'ENOENT') { - errorno = 'ENOTFOUND'; - } - - var e = new Error(syscall + ' ' + errorno); - - e.errno = e.code = errorno; - e.syscall = syscall; - return e; -} +var errnoException = util._errnoException; +var isIp = net.isIP; // c-ares invokes a callback either synchronously or asynchronously, |