15 ms·
There's a `catch` with effects as well, though, the effect handler. And it works very similarly to `catch` in that it's not local to the function, but happens s
by MrJohz 1y ago
There's a `catch` with effects as well, though, the effect handler. And it works very similarly to `catch` in that it's not local to the function, but happens somewhere in the calling code. So if you're looking at a function and you want to know how that function's exceptions get handled, you need to look at the calling code.
- deleted 1y ago[deleted]
- naasking 1y agoThis is the case anytime errors are propagated to callers instead of handled locally, which is probably most cases.
- MrJohz 1y agoJust to clarify because the grammar is a bit ambiguous in your comment: which case do you see as the common case? I suspect in most cases, people don't handle errors where they are thrown, but rather a couple of layers up from that point.
- naasking 1y ago> I suspect in most cases, people don't handle errors where they are thrown, but rather a couple of layers up from that Agreed, that's the point I was trying to make.