-
-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Improve custom panic hook (#2355)
This change improves Sentry CLI's panic hook to make panic messages more user-friendly. The panic message generated by the hook emphasizes that panics are internal errors in the Sentry CLI, and the message directs users to our bug report issue form. The message also always includes a stack backtrace, regardless of whether `RUST_BACKTRACE` is set. The new panic message looks like the following: ``` 🔥 Internal Error in Sentry CLI 🔥 Uh-oh! 😬 Sentry CLI has just crashed due to an internal error. Please open a bug report issue at https://github.com/getsentry/sentry-cli/issues/new?template=BUG_REPORT.yml. 🐞 🔬 Technical Details 🔬 thread 'main' panicked at src/commands/sourcemaps/upload.rs:422:5: test error Stack Backtrace: 0: std::backtrace_rs::backtrace::libunwind::trace at /rustc/9fc6b43126469e3858e2fe86cafb4f0fd5068869/library/std/src/../../backtrace/src/backtrace/libunwind.rs:116:5 1: std::backtrace_rs::backtrace::trace_unsynchronized at /rustc/9fc6b43126469e3858e2fe86cafb4f0fd5068869/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5 [... truncated ...] ``` This change also removes the dependency on the `backtrace` crate, and renames the function which sets the panic hook from `init_backtrace` to `set_panic_hook`.
- Loading branch information
1 parent
8318213
commit 4278c53
Showing
4 changed files
with
72 additions
and
35 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters