Uh oh!
There was an error while loading. Please reload this page.
repl: handle null thrown - #14306
Conversation
There was a problem hiding this comment.
Well, things that are thrown aren't necessarily always errors. Maybe Thrown: or just ${e}\n?
(Also does this work with symbols?)
There was a problem hiding this comment.
@TimothyGu I preferred to make the smaller changed - for it to work with symbols we'd need to wrap it in String (I can do that).
I can change the terminology from Error: to Thrown: I was hoping we could get a little bikeshedding on the message.
There was a problem hiding this comment.
Yeah well, this kinda goes back to #13784, which is still in limbo because of the lack of a good way to stringify an object.
There was a problem hiding this comment.
@TimothyGu yes, but I think String is a good middle ground - I don't want it to be bulletproof - I want it to be useful for users.
There was a problem hiding this comment.
Yeah well, this kinda goes back to #13784, which is still in limbo because of the lack of a good way to stringify an object.
There was a problem hiding this comment.
Is the process.nextTick necessary?
There was a problem hiding this comment.
@TimothyGu yes, to reproduce the issue - without the nextTick it doesn't crash the REPL.
Previous behavior was to assume an error is a proper error in the repl module. A check was added to not terminate the process on thrown repl errors that are `null` or `undefined`. PR-URL: nodejs#14306Fixes: nodejs#12373 Reviewed-By: Anna Henningsen <anna@addaleax.net>
3200c5a to
4dfe7fdComparebenjamingr
commented
Jul 17, 2017
@TimothyGu renamed "Error: " to "Thrown: " and handled thrown symbols. |
| const top = replMap.get(self); | ||
| internalUtil.decorateErrorStack(e); | ||
| const isError = internalUtil.isError(e); |
There was a problem hiding this comment.
Why not process.binding('util').isNativeError?
There was a problem hiding this comment.
@TimothyGu Not sure that's the behaviour I'd want - I'd like people to (optimally) be able to override Symbol.toStringTag (or even the name) and take the "Error like" path if they really need to.
I don't feel strongly about this though. If you do - let me know and I'll change it.
| replserver.emit('line', '.exit'); | ||
| setTimeout(() => { | ||
| console.log(text); |
TimothyGu
commented
Jul 18, 2017
I mean, we can still craft weird scenarios with |
TimothyGu
commented
Jul 19, 2017
Landed in 380e814. |
benjamingr
commented
Jul 19, 2017
@TimothyGu note: you landed this without passing CI (last CI was failing due to changed error message). I've started a CI in https://ci.nodejs.org/job/node-test-pull-request/9246/console |
TimothyGu
commented
Jul 19, 2017
@benjamingr I didn't land this BTW, I just noticed it was landed w/o a "landed" comment. |
benjamingr
commented
Jul 19, 2017
@TimothyGu I landed and immediately force reverted because of the CI (and posted in #node-dev) - currently waiting for CI to land this. |
TimothyGu
commented
Jul 19, 2017
@benjamingr Ah oops. Sorry, should've let you handle this (and checked IRC...) |
benjamingr
commented
Jul 19, 2017
ARM fanned failure on |
benjamingr
commented
Jul 19, 2017
Landed in 030a028 🎉 |
Previous behavior was to assume an error is a proper error in the repl module. A check was added to not terminate the process on thrown repl errors that are `null` or `undefined`. PR-URL: #14306Fixes: #12373 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com
Previous behavior was to assume an error is a proper error in the repl module. A check was added to not terminate the process on thrown repl errors that are `null` or `undefined`. PR-URL: #14306Fixes: #12373 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com
Previous behavior was to assume an error is a proper error in the repl module. A check was added to not terminate the process on thrown repl errors that are `null` or `undefined`. PR-URL: #14306Fixes: #12373 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com
MylesBorins
commented
Aug 16, 2017
Should this be backported to |
MylesBorins
commented
Dec 19, 2017
ping @benjamingr |
1 similar comment
MylesBorins
commented
Jan 11, 2018
ping @benjamingr |
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
repl
Fixes#12373