-
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
more useable fs/promises backtraces on error #50160
Labels
feature request
Issues that request new features to be added to Node.js.
Comments
axkibe
added
the
feature request
Issues that request new features to be added to Node.js.
label
Oct 12, 2023
I guess my PR (#49849) implements this. |
nodejs-github-bot
pushed a commit
that referenced
this issue
Oct 26, 2023
Sync functions in fs throwed an error with a stacktrace which is helpful for debugging. But functions in fs/promises throwed an error without a stacktrace. This commit adds stacktraces by calling Error.captureStacktrace and re-throwing the error. Refs: #34817 PR-URL: #49849 Fixes: #50160 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Zeyu "Alex" Yang <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Jiawen Geng <[email protected]>
alexfernandez
pushed a commit
to alexfernandez/node
that referenced
this issue
Nov 1, 2023
Sync functions in fs throwed an error with a stacktrace which is helpful for debugging. But functions in fs/promises throwed an error without a stacktrace. This commit adds stacktraces by calling Error.captureStacktrace and re-throwing the error. Refs: nodejs#34817 PR-URL: nodejs#49849 Fixes: nodejs#50160 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Zeyu "Alex" Yang <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Jiawen Geng <[email protected]>
targos
pushed a commit
that referenced
this issue
Nov 11, 2023
Sync functions in fs throwed an error with a stacktrace which is helpful for debugging. But functions in fs/promises throwed an error without a stacktrace. This commit adds stacktraces by calling Error.captureStacktrace and re-throwing the error. Refs: #34817 PR-URL: #49849 Fixes: #50160 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Zeyu "Alex" Yang <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Jiawen Geng <[email protected]>
sapphi-red
added a commit
to sapphi-red/node
that referenced
this issue
Dec 12, 2023
Sync functions in fs throwed an error with a stacktrace which is helpful for debugging. But functions in fs/promises throwed an error without a stacktrace. This commit adds stacktraces by calling Error.captureStacktrace and re-throwing the error. Refs: nodejs#34817 PR-URL: nodejs#49849 Fixes: nodejs#50160 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Zeyu "Alex" Yang <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Jiawen Geng <[email protected]>
sapphi-red
added a commit
to sapphi-red/node
that referenced
this issue
Dec 12, 2023
Sync functions in fs throwed an error with a stacktrace which is helpful for debugging. But functions in fs/promises throwed an error without a stacktrace. This commit adds stacktraces by calling Error.captureStacktrace and re-throwing the error. Refs: nodejs#34817 PR-URL: nodejs#49849 Backport-PR-URL: nodejs#51127 Fixes: nodejs#50160 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Zeyu "Alex" Yang <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Jiawen Geng <[email protected]>
sapphi-red
added a commit
to sapphi-red/node
that referenced
this issue
Dec 12, 2023
Sync functions in fs throwed an error with a stacktrace which is helpful for debugging. But functions in fs/promises throwed an error without a stacktrace. This commit adds stacktraces by calling Error.captureStacktrace and re-throwing the error. Refs: nodejs#34817 PR-URL: nodejs#49849 Backport-PR-URL: nodejs#51127 Fixes: nodejs#50160 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Zeyu "Alex" Yang <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Jiawen Geng <[email protected]>
sapphi-red
added a commit
to sapphi-red/node
that referenced
this issue
Mar 26, 2024
Sync functions in fs throwed an error with a stacktrace which is helpful for debugging. But functions in fs/promises throwed an error without a stacktrace. This commit adds stacktraces by calling Error.captureStacktrace and re-throwing the error. Refs: nodejs#34817 PR-URL: nodejs#49849 Backport-PR-URL: nodejs#51127 Fixes: nodejs#50160 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Zeyu "Alex" Yang <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Jiawen Geng <[email protected]>
sapphi-red
added a commit
to sapphi-red/node
that referenced
this issue
Mar 26, 2024
Sync functions in fs throwed an error with a stacktrace which is helpful for debugging. But functions in fs/promises throwed an error without a stacktrace. This commit adds stacktraces by calling Error.captureStacktrace and re-throwing the error. Refs: nodejs#34817 PR-URL: nodejs#49849 Backport-PR-URL: nodejs#51127 Fixes: nodejs#50160 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Zeyu "Alex" Yang <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Jiawen Geng <[email protected]>
marco-ippolito
pushed a commit
that referenced
this issue
Apr 29, 2024
Sync functions in fs throwed an error with a stacktrace which is helpful for debugging. But functions in fs/promises throwed an error without a stacktrace. This commit adds stacktraces by calling Error.captureStacktrace and re-throwing the error. Refs: #34817 PR-URL: #49849 Backport-PR-URL: #51127 Fixes: #50160 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Zeyu "Alex" Yang <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Jiawen Geng <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What is the problem this feature will solve?
Take following minimal test case:
the output will be:
so no hint where.
What is the feature you are proposing to solve the problem?
I used to wrap all fs call to something like this:
So the error stack becomes:
Suggestion: IMO it would be beneficial for node to make these more userfriendly/useful backtraces by default without having to wrap all fs calls by the user?
What alternatives have you considered?
explained above, wrap the fs calls with try/catch blocks all myself, it's very possible, likely someone wrote a npm package anyway, likely several, but IMO this is one of the things the core should come with making the entry easier for new people.
The text was updated successfully, but these errors were encountered: