module: always decorate thrown errors#4287
Conversation
|
CI is all green except flaky tests and CI issues: https://ci.nodejs.org/job/node-test-pull-request/1001/ |
|
LGTM |
|
Using the normal workflow, this will cause two arrow messages to be printed. For example: Where |
|
From a quick test, it looks like removing the arrow information from |
|
Hrmm... what about adding/checking a "decorated" flag as another hidden value on the error object? |
57a9169 to
490c4b8
Compare
|
@cjihrig Alright, I added a 'decorated' flag and a new test for uncaught errors. CI is all green except flaky tests/CI issues: https://ci.nodejs.org/job/node-test-pull-request/1006/ |
490c4b8 to
fbcb95a
Compare
9dc88d1 to
ed203d0
Compare
|
Incorporated suggestions and CI is green except flaky tests: https://ci.nodejs.org/job/node-test-pull-request/1010/ |
|
LGTM |
lib/internal/util.js
Outdated
There was a problem hiding this comment.
I'd probably give this a slightly more unique name, e.g. 'node:decorated'. (Ditto for 'arrowMessage' although this PR didn't introduce that.)
|
semver-minor? |
ed203d0 to
ac1633b
Compare
|
@bnoordhuis I've made your suggested changes. LGTY now? |
src/node.cc
Outdated
There was a problem hiding this comment.
Superfluous parentheses and you can shorten it to return !decorated.IsEmpty() && decorated->IsTrue(), which should also be infinitesimally faster.
|
LGTM with a nit and a suggestion. |
This provides more information when encountering a syntax or similar error when executing a file with require().
ac1633b to
e7ac2fc
Compare
|
Updated commit. Last CI run: https://ci.nodejs.org/job/node-test-pull-request/1022/ |
|
@jasnell I'm not sure how this fits in (if at all) with whatever was agreed upon on with regard to changing errors and semver-ness, but my guess would be semver-major since it's changing the formatting of the stack trace? |
|
Landed in 18490d3. |
This provides more information when encountering a syntax or similar error when executing a file with require(). Fixes: nodejs#4286 PR-URL: nodejs#4287 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Notable changes: * general: Several minor performance improvements: - lib: Use arrow functions instead of bind where possible (Minwoo Jung) nodejs#3622 - node: Improved accessor perf of process.env (Trevor Norris) nodejs#3780 - **node**: Improved performance of hrtime() (Trevor Norris) nodejs#3780 - node: Improved GetActiveHandles performance (Trevor Norris) nodejs#3780 * module: Errors during require() now provide more information (Brian White) nodejs#4287
|
Marking as semver-major due to the error handling change. It's not clear if this is major or minor tho. @nodejs/ctc |
This provides more information when encountering a syntax or similar error when executing a file with require(). Fixes: nodejs#4286 PR-URL: nodejs#4287 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This provides more information when encountering a syntax or similar error when executing a file with require().