-
-
Notifications
You must be signed in to change notification settings - Fork 226
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(errors): Print backtrace when
RUST_BACKTRACE=1
(#2189)
The anyhow crate we use for error handling adds stack backtraces errors whenever certain standard environment variables are set (e.g. when RUST_BACKTRACE=1). Modify our error-printing logic to include these stack backtraces when printing errors that crash Sentry CLI, so that users can add this information to bug reports. Closes #2187
- Loading branch information
1 parent
7160d52
commit 67c267a
Showing
6 changed files
with
38 additions
and
7 deletions.
There are no files selected for viewing
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
18 changes: 18 additions & 0 deletions
18
tests/integration/_cases/info/info-no-token-backtrace.trycmd
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
``` | ||
$ RUST_BACKTRACE=1 sentry-cli info | ||
? failed | ||
Sentry Server: https://sentry.io | ||
Default Organization: - | ||
Default Project: - | ||
|
||
Authentication Info: | ||
Method: Unauthorized | ||
error: Auth token is required for this request. Please run `sentry-cli login` and try again! | ||
|
||
Stack backtrace: | ||
... | ||
|
||
Add --log-level=[info|debug] or export SENTRY_LOG_LEVEL=[info|debug] to see more output. | ||
Please attach the full debug log to all bug reports. | ||
|
||
``` |
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