-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
util: moving internal helpers to internal module #2025
Conversation
@@ -34,7 +35,7 @@ const O_WRONLY = constants.O_WRONLY || 0; | |||
const isWindows = process.platform === 'win32'; | |||
|
|||
const DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); | |||
const errnoException = util._errnoException; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this break graceful-fs
again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would. It's probably better to add a test for this to prevent accidental breakage
@cjihrig why semver-major? |
@@ -40,3 +42,42 @@ exports.deprecate = function(fn, msg) { | |||
|
|||
return deprecated; | |||
}; | |||
|
|||
exports._errnoException = function(err, syscall, original) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is going into an internal module, it doesn't need the underscore name.
Also, can we name the function (exports.errnoException = function errnoException(..) {
) so we don't have to deal with exports.errnoException()
below?
I'm going to relabel this as semver-minor as backwards compatibility is kept. |
1. Moving `_errnoException` and `_exceptionWithHostPort` to `internal/util` module as they are internal helper functions. They should not be exposed as part of the `util` module. 2. Issuing a deprecation warning when those functions are used.
e.errno = errname; | ||
e.syscall = syscall; | ||
return e; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this useful for making errors from libuv bindings in userland?
There are other modules this might break. But it's probably their fault.
|
Closing this as it breaks |
@thefourtheye Perhaps it's time to reopen and revisit, as #6413 is going to be landed soon? We would probably need a deprecation message on |
@thefourtheye, #6413 landed, nothing is blocking this anymore. Do you wish to redo/reopen this PR? |
_errnoException
and_exceptionWithHostPort
tointernal/util
module as they are internal helper functions. Theyshould not be exposed as part of the
util
module.