diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2018-02-03 17:09:15 +0800 |
---|---|---|
committer | Joyee Cheung <joyeec9h3@gmail.com> | 2018-02-07 18:42:40 +0800 |
commit | c0762c2f54f80b92f2f5e0f9af51f4c048c53e4f (patch) | |
tree | d6bcae1119e5cfdc03675b148cdca784686be10e /lib/dgram.js | |
parent | 030384833f95ee9f61fc194cdcab4075df083926 (diff) | |
download | android-node-v8-c0762c2f54f80b92f2f5e0f9af51f4c048c53e4f.tar.gz android-node-v8-c0762c2f54f80b92f2f5e0f9af51f4c048c53e4f.tar.bz2 android-node-v8-c0762c2f54f80b92f2f5e0f9af51f4c048c53e4f.zip |
errors: move error creation helpers to errors.js
This commit moves error creation helpers scattered around
under lib/ into lib/internal/errors.js in the hope of being clearer
about the differences of errors that we throw into the user land.
- Move util._errnoException and util._exceptionWithHostPort
into internal/errors.js and simplify their logic so it's
clearer what the properties these helpers create.
- Move the errnoException helper in dns.js to internal/errors.js
into internal/errors.js and rename it to dnsException. Simplify
it's logic so it no longer calls errnoException and skips
the unnecessary argument checks.
PR-URL: https://github.com/nodejs/node/pull/18546
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib/dgram.js')
-rw-r--r-- | lib/dgram.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/dgram.js b/lib/dgram.js index 0c4990cac5..bed6129b47 100644 --- a/lib/dgram.js +++ b/lib/dgram.js @@ -45,8 +45,8 @@ const SEND_BUFFER = false; // Lazily loaded var cluster = null; -const errnoException = util._errnoException; -const exceptionWithHostPort = util._exceptionWithHostPort; +const errnoException = errors.errnoException; +const exceptionWithHostPort = errors.exceptionWithHostPort; function lookup4(lookup, address, callback) { |