mirror of
https://github.com/nushell/nushell.git
synced 2025-02-23 05:51:28 +01:00
A small follow-up to #7221. This changes the `catch` block from a block to a closure, so that it can access the error returned from the `try` block. This helps with a common scenario: "the `try` block failed, and I want to log why it failed." ### Example  ### Future Work Nu's closure syntax is a little awkward here; it might be nicer to allow something like `catch err { print $err }`. We discussed this on Discord and it will require special parser code similar to what's already done for `for`. I'm not feeling confident enough in my parser knowledge to make that change; I will spend some more time looking at the `for` code but I doubt I will be able to implement anything in the next few days. Volunteers welcome. |
||
---|---|---|
.. | ||
assets | ||
proptest-regressions/format_conversions | ||
src | ||
tests | ||
build.rs | ||
Cargo.toml | ||
LICENSE |