From 33ce958047f654c375fea03e82a44d4c5544d056 Mon Sep 17 00:00:00 2001 From: Feng Yu Date: Sun, 22 May 2022 21:07:20 +0800 Subject: [PATCH] lib: re-export error code constants from `dns/promises` --- lib/dns/promises.js | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/lib/dns/promises.js b/lib/dns/promises.js index ad8a2561ef51e4..0dfeff7bc9650f 100644 --- a/lib/dns/promises.js +++ b/lib/dns/promises.js @@ -1,5 +1,34 @@ 'use strict'; const dnsPromises = require('internal/dns/promises'); -dnsPromises.setServers = require('dns').setServers; +const dns = require('dns'); + +dnsPromises.setServers = dns.setServers; + +// ERROR CODES +dnsPromises.NODATA = dns.NODATA; +dnsPromises.FORMERR = dns.FORMERR; +dnsPromises.SERVFAIL = dns.SERVFAIL; +dnsPromises.NOTFOUND = dns.NOTFOUND; +dnsPromises.NOTIMP = dns.NOTIMP; +dnsPromises.REFUSED = dns.REFUSED; +dnsPromises.BADQUERY = dns.BADQUERY; +dnsPromises.BADNAME = dns.BADNAME; +dnsPromises.BADFAMILY = dns.BADFAMILY; +dnsPromises.BADRESP = dns.BADRESP; +dnsPromises.CONNREFUSED = dns.CONNREFUSED; +dnsPromises.TIMEOUT = dns.TIMEOUT; +dnsPromises.EOF = dns.EOF; +dnsPromises.FILE = dns.FILE; +dnsPromises.NOMEM = dns.NOMEM; +dnsPromises.DESTRUCTION = dns.DESTRUCTION; +dnsPromises.BADSTR = dns.BADSTR; +dnsPromises.BADFLAGS = dns.BADFLAGS; +dnsPromises.NONAME = dns.NONAME; +dnsPromises.BADHINTS = dns.BADHINTS; +dnsPromises.NOTINITIALIZED = dns.NOTINITIALIZED; +dnsPromises.LOADIPHLPAPI = dns.LOADIPHLPAPI; +dnsPromises.ADDRGETNETWORKPARAMS = dns.ADDRGETNETWORKPARAMS; +dnsPromises.CANCELLED = dns.CANCELLED; + module.exports = dnsPromises;