Skip to content

Commit e53a298

Browse files
committed
Change error formatting to omit backtraces
The format specifier we use for printing errors returned by the main program will include a backtrace in the output -- if one is available. That's not necessarily a feature that we need: the causal chain of errors should be sufficient and end users are unlikely to have use for a backtrace. This change adjusts the format specifier so that we only print the chain of errors, albeit in a slightly different format: - Previously: > Failed to generate OTP > > Caused by: > Command error: The given slot is not programmed - New: > Failed to generate OTP: Command error: The given slot is not programmed
1 parent 49f518f commit e53a298

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Unreleased
33
- Introduced extension support crate, `nitrocli-ext`
44
- Introduced `otp-cache` core extension
55
- Enabled usage of empty PWS slot fields
6+
- Changed error reporting format to make up only a single line
67
- Added `NITROCLI_RESOLVED_USB_PATH` environment variable to be used by
78
extensions
89
- Allowed entering of `base32` encoded strings containing spaces

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ fn evaluate_err(err: anyhow::Error, stderr: &mut dyn io::Write) -> i32 {
233233
if let Some(err) = err.root_cause().downcast_ref::<DirectExitError>() {
234234
err.0
235235
} else {
236-
let _ = writeln!(stderr, "{:?}", err);
236+
let _ = writeln!(stderr, "{:#}", err);
237237
1
238238
}
239239
}

0 commit comments

Comments
 (0)