Unverified Commit c0762c2f authored by Joyee Cheung's avatar Joyee Cheung
Browse files

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: default avatarJames M Snell <jasnell@gmail.com>
parent 03038483
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment