Stream: beginners

Topic: Stop unwinding


view this post on Zulip Kasper Møller Andersen (Sep 27 2024 at 15:47):

Quick question: Roc has crash (similarly to panic! in Rust), but does it also have an equivalent to catch_unwind?

view this post on Zulip Richard Feldman (Sep 27 2024 at 15:51):

no, and the explicit plan is to never introduce anything like that :big_smile:

view this post on Zulip Kasper Møller Andersen (Sep 27 2024 at 15:52):

Alright, thanks :D

view this post on Zulip Richard Feldman (Sep 27 2024 at 15:53):

to elaborate, crash is intended to be used only when there is no possible way to gracefully recover, and exiting the program is the only option - or when you're in a branch that you think should never be reachable (and there's no reasonable way to rule out that branch at compile time)

view this post on Zulip Kasper Møller Andersen (Sep 27 2024 at 15:54):

Yup, that was my assumption. I'm still just mulling over error handling in general, so I just wanted to check before I go off on some irrelevant tangent :stuck_out_tongue:


Last updated: Jul 06 2025 at 12:14 UTC