Bug report form
Describe the bug
Adding a finally block after try/catch suppresses printing to stdout of errors raised in the try/catch blocks:
With just try and catch, things are as expected:
$ try { error make { msg: foo } } catch { error make { msg: bar } }
Error: nu::shell::error
× bar
╭─[repl_entry #12:1:52]
1 │ try { error make { msg: foo } } catch { error make { msg: bar } }
· ────────────
╰────
Error:
× foo
╭─[repl_entry #12:1:18]
1 │ try { error make { msg: foo } } catch { error make { msg: bar } }
· ────────────
╰────
But if you add a finally block, neither error is printed:
$ try { error make { msg: foo } } catch { error make { msg: bar } } finally { print baz }
baz
How to reproduce
$ try { error make { msg: foo } } catch { error make { msg: bar } }
$ try { error make { msg: foo } } catch { error make { msg: bar } } finally { print baz }
Expected behavior
My expectation would be that, in the second case, the same errors should be printed as in the first case (in addition to the string baz printed from the finally block).
Configuration
$ version | transpose key value | to md --pretty
| key |
value |
| version |
0.111.0 |
| major |
0 |
| minor |
111 |
| patch |
0 |
| branch |
|
| commit_hash |
|
| build_os |
macos-aarch64 |
| build_target |
aarch64-apple-darwin |
| rust_version |
rustc 1.94.0 (4a4ef493e 2026-03-02) |
| rust_channel |
stable-aarch64-apple-darwin |
| cargo_version |
cargo 1.94.0 (85eff7c80 2026-01-15) |
| build_time |
2026-03-08 21:17:48 -04:00 |
| build_rust_channel |
release |
| allocator |
standard |
| features |
default, mcp, network, plugin, rustls-tls, sqlite, trash-support |
| installed_plugins |
highlight 1.4.10+0.108.0, skim 0.10.0 |
| experimental_options |
example=false, reorder-cell-paths=true, pipefail=true, enforce-runtime-annotations=true, native-clip=true |
Bug report form
Describe the bug
Adding a
finallyblock after try/catch suppresses printing to stdout of errors raised in the try/catch blocks:With just try and catch, things are as expected:
But if you add a finally block, neither error is printed:
How to reproduce
Expected behavior
My expectation would be that, in the second case, the same errors should be printed as in the first case (in addition to the string
bazprinted from the finally block).Configuration
$ version | transpose key value | to md --pretty