| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
(Not sure which PR is the right place to ask, this one seems the oldest so I'll ask here)
Which one does the "type" here cover:
Sorry, something went wrong.
There was a problem hiding this comment.
Also, some PRs use the typeof types as the expected type(e.g. "function"), some uses the class name/type tag(e.g. "Object"), we probably need to be a little bit consistent on this one.
Sorry, something went wrong.
There was a problem hiding this comment.
This is not handled very consistently throughout the Node.js source. Sometimes the value itself is passed in, sometimes the typeof is used, etc. The goal here would be to start getting some consistency but it's hard to nail down exactly what that should be.
Sorry, something went wrong.
There was a problem hiding this comment.
Got it, so we should focus on migrating the errors to use the new system with a reasonable code right now, and deal with message later, because after the migration it would be easier to change them anyway?
Sorry, something went wrong.
There was a problem hiding this comment.
String(..) seems unnecessary here?
Sorry, something went wrong.
There was a problem hiding this comment.
+1. It's already cast on line 103
Sorry, something went wrong.
|
@nodejs/ctc ... as a semver major this needs some review and signoff |
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
@jasnell in the invalidArgType : what if the actual arg is null , the result will be . Received type object
Sorry, something went wrong.
|
Sigh, good point. I often forget that typeof null === 'object' which is really quite odd. |
Sorry, something went wrong.
There was a problem hiding this comment.
#11298 spells the full UNKNOWN, this should do the same (TBH I can not understand what UNK stands for at first glance...).
Sorry, something went wrong.
|
@nodejs/ctc ... PTAL... I'd like to get this landed so we can start getting through the others that are starting to stack up |
Sorry, something went wrong.
|
ping @evanlucas, @addaleax, @cjihrig and @mhdawson |
Sorry, something went wrong.
|
@nodejs/ctc ... I need at least one more CTC member sign off on this to proceed. |
Sorry, something went wrong.
|
As I mentioned somewhere else (not sure where, there have been a bunch of these pull requests), I'm not thrilled with what the stack trace looks like after this change. |
Sorry, something went wrong.
|
Which part are you unhappy with? |
Sorry, something went wrong.
$ ./node --expose-internals
> new errors.Error('ERR_ASSERTION', 'something')
{ Error[ERR_ASSERTION]: something
at repl:1:1
at ContextifyScript.Script.runInThisContext (vm.js:44:33)
at REPLServer.defaultEval (repl.js:239:29)
at bound (domain.js:301:14)
at REPLServer.runBound [as eval] (domain.js:314:12)
at REPLServer.onLine (repl.js:433:10)
at emitOne (events.js:120:20)
at REPLServer.emit (events.js:210:7)
at REPLServer.Interface._onLine (readline.js:262:10)
at REPLServer.Interface._line (readline.js:611:8) [Symbol(code)]: 'ERR_ASSERTION' }I just find it a little harder to read Error[ERR_ASSERTION]: in particular. As opposed to Error: |
Sorry, something went wrong.
|
Do you have an alternative suggestion? Displaying the error code in the output is a significant reason why this allows us to avoid treating changes in the error message as semver-major... That is, it gives the user a stable, non-changing key they can use to search for information on the specific error. Putting the [ERR_ASSERTION] on the other side of the : requires changing the actual error message. |
Sorry, something went wrong.
I can't find it either, but I chimed in on that too. Error[ERR_ASSERTION] looks like an array value. At an absolute minimum, please put a space in there: Error [ERR_ASSERTION]: If @evanlucas's output is accurate, the { and } surrounding the output should also be removed. They suggest the contents are an object or JSON. |
Sorry, something went wrong.
|
The { and } is an artifact of util.inspect() rendering, not the internal errors piece.... for instance, do > var m = new Error("test")
undefined
> m.code = 1
1
> m
{ Error: test
at repl:1:9
at ContextifyScript.Script.runInThisContext (vm.js:44:33)
at REPLServer.defaultEval (repl.js:239:29)
at bound (domain.js:301:14)
at REPLServer.runBound [as eval] (domain.js:314:12)
at REPLServer.onLine (repl.js:433:10)
at emitOne (events.js:120:20)
at REPLServer.emit (events.js:210:7)
at REPLServer.Interface._onLine (readline.js:262:10)
at REPLServer.Interface._line (readline.js:611:8) code: 1 }I will open a PR that adds the space before the opening [ |
Sorry, something went wrong.
PR: #12099 |
Sorry, something went wrong.
|
Ping @nodejs/ctc ... I'd like to get this landed. Before the other errors ones get landed. |
Sorry, something went wrong.
|
@jasnell This needs at least one more CTC approval before landing. Maybe you can horse-trade with @trevnorris: You review his async-hooks PR that he's not getting enough reviews on and in return he reviews this. I'm kidding. Or am I? |
Sorry, something went wrong.
|
I'd review the async-hooks had I the time. It's a large pr. I can take a look next week. There are quite a few other prs pending on this one, all semver major, that I would like to get landed |
Sorry, something went wrong.
There was a problem hiding this comment.
Maybe break out the expected.slice().join() into a variable? It is getting a little hard to read imo.
Sorry, something went wrong.
There was a problem hiding this comment.
With only the first three arguments being used, maybe make this if (arguments.length === 3) {?
Feel free to disregard
Sorry, something went wrong.
|
@evanlucas ... do you still object to this? |
Sorry, something went wrong.
|
@jasnell my review was not an objection. I think I'm onboard with this now. |
Sorry, something went wrong.
|
Awesome, ok. Can I ask you to switch the "requested changes" to an approval or LGTM so I can get this landed. As a semver-major I need two CTC signoffs :-) |
Sorry, something went wrong.
* Assign codes to the handful of errors reported by internal/process/*.js * Include documentation for the new error codes * Improve error messages * Improve test coverage for process.nextTick Ref: nodejs#11273
|
Final CI before landing: https://ci.nodejs.org/job/node-test-pull-request/7553/ |
Sorry, something went wrong.
|
CI failures are unrelated. Failures in CITGM are not specific to this PR. |
Sorry, something went wrong.
* Assign codes to the handful of errors reported by internal/process/*.js * Include documentation for the new error codes * Improve error messages * Improve test coverage for process.nextTick PR-URL: #11294 Ref: #11273 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com>
| Back | FazBrowse Home | New Git URL |
Ref: #11273
Semver-major because this updates specific error messages and converts errors over to use the new internal/errors.js mechanism.
Checklist
Affected core subsystem(s)
errors, process