Skip to content

Commit

Permalink
process: use internal/errors in internalNextTick
Browse files Browse the repository at this point in the history
PR-URL: #13982
Refs: #12892
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
tniessen authored and addaleax committed Jul 18, 2017
1 parent f1ef692 commit 539f4c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/internal/process/next_tick.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ function setupNextTick() {
// about to exit since the callback would not have a chance to be executed.
function internalNextTick(triggerAsyncId, callback) {
if (typeof callback !== 'function')
throw new TypeError('callback is not a function');
throw new errors.TypeError('ERR_INVALID_CALLBACK');
// CHECK(Number.isSafeInteger(triggerAsyncId) || triggerAsyncId === null)
// CHECK(triggerAsyncId > 0 || triggerAsyncId === null)

Expand Down

3 comments on commit 539f4c0

@davidmurdoch
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious if the breaking changes like this one (ERR_INVALID_CALLBACK maps to the message Callback must be a function, not callback is not a function) are being documented anywhere.

@addaleax
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davidmurdoch Are you asking about the fact that this kind of changes is a breaking change, or a list of these specific semver-major commits? If it’s the latter: Our changelogs explicitly label commits according to their semverness, but this one won’t be released until Node 9, so it’s going to be a while.

@davidmurdoch
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just hoping for a "Here's whats going to break when you upgrade:" list of .messages that change. I hadn't really taken a good look at other error message changes, but it looks like most of the .message strings will be changing, so maybe this specific list of which changed and which stayed the same won't really be necessary, as we'll all need and want to update most of them anyway to check the .code anyway.

Please sign in to comment.