4 ms·
It looks like exceptions (write the happy path in direct style, etc), but with exceptions, there is a `catch`. You can look for it and see the alternate path.
by nine_k 1y ago
It looks like exceptions (write the happy path in direct style, etc), but with exceptions, there is a `catch`. You can look for it and see the alternate path.
What might be a good way to find / navigate to the effectual context quickly? Should we just expect an IDE / LSP color it differently, or something?
- MrJohz 1y agoThere'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.