-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Nushell error messages should only display "backtrace" info message when it will change the output #15070
Copy link
Copy link
Closed
Labels
A:error-handlingHow errors in externals/nu code are caught or handled programmatically (see also unhelpful-error)How errors in externals/nu code are caught or handled programmatically (see also unhelpful-error)A:error-unhelpfulThe error message you observe is not helpful to identify the problemThe error message you observe is not helpful to identify the problemcategory:enhancementNew feature or requestNew feature or request
Milestone
Description
Related problem
#14945 is nice, but most Nushell CLI errors aren't going to have a bracktrace. Having the
let string = oops-this-is-a-command-position
# => Error: nu::shell::external_command
# =>
# => × External command failed
# => ╭─[entry #7:1:14]
# => 1 │ let string = oops-this-is-a-command-position
# => · ───────────────┬───────────────
# => · ╰── Command `oops-this-is-a-command-position` not found
# => ╰────
# => help: `oops-this-is-a-command-position` is neither a Nushell built-in or a known external command
# =>
# => set the `NU_BACKTRACE=1` environment variable to display a backtrace.Setting NU_BACKTRACE isn't going to change anything, except to get rid of the last two lines of the error above.
Describe the solution you'd like
Either only display the NU_BACKTRACE info message if there is more than one error in the chain (if possible) or, can we just get rid of that message altogether and make it part of the documentation instead? While useful, I don't know that it's going to be as critical as having a backtrace on a panic, and Nushell errors are very common compared to panics.
Side-note: The message should reference $env.NU_BACKTRACE = 1 rather than the POSIX-style.
Describe alternatives you've considered
No response
Additional context and details
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A:error-handlingHow errors in externals/nu code are caught or handled programmatically (see also unhelpful-error)How errors in externals/nu code are caught or handled programmatically (see also unhelpful-error)A:error-unhelpfulThe error message you observe is not helpful to identify the problemThe error message you observe is not helpful to identify the problemcategory:enhancementNew feature or requestNew feature or request