-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-error-handlingArea: Error handlingArea: Error handlingPG-error-handlingProject group: Error handling (https://github.com/rust-lang/project-error-handling)Project group: Error handling (https://github.com/rust-lang/project-error-handling)T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
Hi.
It can be very useful in a production environment to know where a panic
comes from, which you can know by enabling RUST_BACKTRACE
.
However, using the same environment variable for error backtrace could lead to performance regression: your production service might require good performance and collecting a backtrace is very expansive.
Since errors are more often recovered than panics, you might not want to pay the cost of collecting backtraces for errors, while still might want to know the path which lead to a panic.
So I suggest you don't use RUST_BACKTRACE
for error backtraces, to have the possibility to only get backtraces on panics, not on normal errors.
Thanks.
Metadata
Metadata
Assignees
Labels
A-error-handlingArea: Error handlingArea: Error handlingPG-error-handlingProject group: Error handling (https://github.com/rust-lang/project-error-handling)Project group: Error handling (https://github.com/rust-lang/project-error-handling)T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.