mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 02:05:02 +02:00
Remove BACKTRACE message for non-panic errors (#15143)
# Description Resolves #15070 by removing the `BACKTRACE` message from all Nushell (non-panic) errors. This was added in #14945 and is useful for debugging, but not all that helpful to the typical shell user, especially since most shell errors won't have a backtrace anyway. At some point it would be nice to display this message only when there *is* a backtrace available. # User-Facing Changes Error messages will be more concise. # Tests + Formatting Updated tests. - 🟢 `toolkit fmt` - 🟢 `toolkit clippy` - 🟢 `toolkit test` - 🟢 `toolkit test stdlib` # After Submitting We should include information in the *"Custom Commands"* chapter of the documentation on how to enable this for debugging.
This commit is contained in:
@ -60,7 +60,7 @@ fn fancy_default_errors() {
|
||||
|
||||
assert_eq!(
|
||||
actual.err,
|
||||
"Error: \u{1b}[31m×\u{1b}[0m oh no!\n ╭─[\u{1b}[36;1;4mline2:1:13\u{1b}[0m]\n \u{1b}[2m1\u{1b}[0m │ force_error \"My error\"\n · \u{1b}[35;1m ─────┬────\u{1b}[0m\n · \u{1b}[35;1m╰── \u{1b}[35;1mhere's the error\u{1b}[0m\u{1b}[0m\n ╰────\n\nset the `NU_BACKTRACE=1` environment variable to display a backtrace.\n"
|
||||
"Error: \u{1b}[31m×\u{1b}[0m oh no!\n ╭─[\u{1b}[36;1;4mline2:1:13\u{1b}[0m]\n \u{1b}[2m1\u{1b}[0m │ force_error \"My error\"\n · \u{1b}[35;1m ─────┬────\u{1b}[0m\n · \u{1b}[35;1m╰── \u{1b}[35;1mhere's the error\u{1b}[0m\u{1b}[0m\n ╰────\n\n"
|
||||
);
|
||||
}
|
||||
|
||||
@ -92,7 +92,6 @@ snippet line 1: force_error "my error"
|
||||
label at line 1, columns 13 to 22: here's the error
|
||||
|
||||
|
||||
set the `NU_BACKTRACE=1` environment variable to display a backtrace.
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user