Reilly Wood ed1f0eb231
Make catch block a closure w/ access to error (#7228)
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


![image](https://user-images.githubusercontent.com/26268125/203841966-f1f8f102-fd73-41e6-83bc-bf69ed436fa8.png)

### 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.
2022-11-25 07:02:20 +13:00
..
2022-10-20 23:28:18 +13:00
2022-08-11 11:54:54 -05:00
2022-11-22 16:58:11 -08:00
2022-09-11 11:48:27 +03:00
2022-10-14 21:51:44 +02:00
2022-02-07 14:54:06 -05:00
2022-11-05 07:38:39 +13:00
2022-02-07 14:54:06 -05:00
2022-09-01 08:32:56 +12:00
2022-02-07 14:54:06 -05:00
2022-09-05 16:41:06 +02:00
2022-11-21 17:04:36 +01:00
2022-02-17 06:40:24 -05:00
2022-02-07 14:54:06 -05:00
2022-09-11 11:48:27 +03:00
2022-02-16 12:24:45 -06:00
2022-05-18 20:47:26 -05:00
2022-07-04 06:31:50 +12:00
2022-02-07 14:54:06 -05:00
2022-11-11 19:51:08 +13:00
2022-02-07 14:54:06 -05:00
2022-11-24 17:52:11 +13:00
2022-11-22 16:58:11 -08:00
2022-05-13 06:47:11 -05:00
2022-09-11 11:48:27 +03:00
2022-09-11 11:48:27 +03:00
2022-11-10 10:57:44 +13:00
2022-02-07 14:54:06 -05:00
2022-11-09 17:06:47 -08:00
2022-02-07 14:54:06 -05:00
2022-02-07 14:54:06 -05:00
2022-09-28 13:48:34 +13:00
2022-11-22 16:58:11 -08:00
2022-03-24 16:42:41 +13:00
2022-11-12 07:21:45 +13:00
2022-02-22 11:32:29 -05:00
2022-09-11 11:48:27 +03:00