-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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: make sure error causes of any type may be inspected #41097
Conversation
I also found that falsy causes are not inspected, but that can be fixed in a separate PR. |
@targos how would you handle |
I would always inspect if |
@targos I added another commit to also inspect falsy values besides |
An error cause may be of any type. Handle all of them, no matter if they are an error or not. Fixes: nodejs#41096 Signed-off-by: Ruben Bridgewater <[email protected]>
Signed-off-by: Ruben Bridgewater <[email protected]>
3f03997
to
38fc7f8
Compare
Okay, I don't have a strong opinion, but |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@nodejs/util PTAL. This should ideally land before the next release. |
Commit Queue failed- Loading data for nodejs/node/pull/41097 ✔ Done loading data for nodejs/node/pull/41097 ----------------------------------- PR info ------------------------------------ Title util: make sure error causes of any type may be inspected (#41097) Author Ruben Bridgewater (@BridgeAR) Branch BridgeAR:fix-non-error-cause-inspection -> nodejs:master Labels util, author ready, needs-ci Commits 2 - util: make sure error causes of any type may be inspected - util: serialize falsy cause values while inspecting errors Committers 1 - Ruben Bridgewater PR-URL: https://github.com/nodejs/node/pull/41097 Fixes: https://github.com/nodejs/node/issues/41096 Reviewed-By: Michaël Zasso Reviewed-By: James M Snell ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/41097 Fixes: https://github.com/nodejs/node/issues/41096 Reviewed-By: Michaël Zasso Reviewed-By: James M Snell -------------------------------------------------------------------------------- ℹ This PR was created on Mon, 06 Dec 2021 13:34:46 GMT ✔ Approvals: 2 ✔ - Michaël Zasso (@targos) (TSC): https://github.com/nodejs/node/pull/41097#pullrequestreview-824046654 ✔ - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/41097#pullrequestreview-826822688 ✔ Last GitHub Actions successful ℹ Last Full PR CI on 2021-12-07T19:10:46Z: https://ci.nodejs.org/job/node-test-pull-request/41399/ - Querying data for job/node-test-pull-request/41399/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ No git cherry-pick in progress ✔ No git am in progress ✔ No git rebase in progress -------------------------------------------------------------------------------- - Bringing origin/master up to date... From https://github.com/nodejs/node * branch master -> FETCH_HEAD ✔ origin/master is now up-to-date - Downloading patch for 41097 From https://github.com/nodejs/node * branch refs/pull/41097/merge -> FETCH_HEAD ✔ Fetched commits as 18ff5832501b..38fc7f86a0bf -------------------------------------------------------------------------------- Auto-merging lib/internal/util/inspect.js [master 12b79bd4f5] util: make sure error causes of any type may be inspected Author: Ruben Bridgewater Date: Mon Dec 6 14:22:30 2021 +0100 3 files changed, 39 insertions(+), 1 deletion(-) Auto-merging lib/internal/util/inspect.js Auto-merging test/parallel/test-util-inspect.js [master 1272d9fe5a] util: serialize falsy cause values while inspecting errors Author: Ruben Bridgewater Date: Mon Dec 6 15:25:42 2021 +0100 2 files changed, 12 insertions(+), 1 deletion(-) ✔ Patches applied There are 2 commits in the PR. Attempting autorebase. Rebasing (2/4)https://github.com/nodejs/node/actions/runs/1555617774 |
@BridgeAR this didn't land cleanly into the release, can you backport this to v17.x-staging? |
@danielleadams this should land cleanly on top of #41002. |
An error cause may be of any type. Handle all of them, no matter if they are an error or not. Fixes: #41096 Signed-off-by: Ruben Bridgewater <[email protected]> PR-URL: #41097 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Anto Aravinth <[email protected]>
Signed-off-by: Ruben Bridgewater <[email protected]> PR-URL: #41097 Fixes: #41096 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Anto Aravinth <[email protected]>
@BridgeAR the spec for error cause very intentionally differentiates between an absent property, and a present |
@ljharb I am fine if you like to also visualize an |
See #41097 (comment) PR-URL: #41247 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: James M Snell <[email protected]>
See #41097 (comment) PR-URL: #41247 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: James M Snell <[email protected]>
An error cause may be of any type. Handle all of them, no matter if they are an error or not. Fixes: #41096 Signed-off-by: Ruben Bridgewater <[email protected]> PR-URL: #41097 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Anto Aravinth <[email protected]>
Signed-off-by: Ruben Bridgewater <[email protected]> PR-URL: #41097 Fixes: #41096 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Anto Aravinth <[email protected]>
An error cause may be of any type. Handle all of them, no matter if they are an error or not. Fixes: #41096 Signed-off-by: Ruben Bridgewater <[email protected]> PR-URL: #41097 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Anto Aravinth <[email protected]>
Signed-off-by: Ruben Bridgewater <[email protected]> PR-URL: #41097 Fixes: #41096 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Anto Aravinth <[email protected]>
See #41097 (comment) PR-URL: #41247 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: James M Snell <[email protected]>
An error cause may be of any type. Handle all of them, no matter if they are an error or not. Fixes: nodejs#41096 Signed-off-by: Ruben Bridgewater <[email protected]> PR-URL: nodejs#41097 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Anto Aravinth <[email protected]>
Signed-off-by: Ruben Bridgewater <[email protected]> PR-URL: nodejs#41097 Fixes: nodejs#41096 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Anto Aravinth <[email protected]>
See nodejs#41097 (comment) PR-URL: nodejs#41247 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: James M Snell <[email protected]>
An error cause may be of any type. Handle all of them, no matter if they are an error or not. Fixes: #41096 Signed-off-by: Ruben Bridgewater <[email protected]> PR-URL: #41097 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Anto Aravinth <[email protected]>
Signed-off-by: Ruben Bridgewater <[email protected]> PR-URL: #41097 Fixes: #41096 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Anto Aravinth <[email protected]>
See #41097 (comment) PR-URL: #41247 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: James M Snell <[email protected]>
An error cause may be of any type. Handle all of them, no matter
if they are an error or not.
Fixes: #41096
Signed-off-by: Ruben Bridgewater [email protected]