Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions blog/2024-09-17-nushell_0_98_0.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,20 @@ As part of this release, we also publish a set of optional plugins you can insta
See a full overview of the [breaking changes](#all-breaking-changes-toc)
:::

::: warning New error behavior
This release adds a new error when an [external exits with a non-zero exit code](#non-zero-exit-codes-are-now-errors-toc). In the default config, this error is suppressed in the REPL. However, **if you are upgrading with an existing config, you must add this section to your $env.config to suppress this error**:

```nushell
display_errors: {
exit_code: false
# Core dump errors are always printed, and SIGPIPE never triggers an error.
# The setting below controls message printing for termination by all other signals.
termination_signal: true
}
```

:::

One long-requested feature for nushell is to make non-zero exit codes throw an error. Before this release, non-zero exit codes would quietly stop execution. In some cases, execution would not even stop, but rather only skip over the remaining commands in the current code block. With this release, non-zero exit codes (and termination due to unix signals) are now errors just like any other error, so nushell now runs almost as if bash's `set -e` option was enabled ([#13515](https://github.com/nushell/nushell/pull/13515)).

Errors due to non-zero exit codes can be caught in a `try`/`catch` block, and the error record passed to the catch closure will contain an `exit_code` column in this case.
Expand Down