-
I've been definiing custom effects as described in Effectful.Dispatch.Dynamic My application has a large runner which adds all the effects, then in my functions, I rely only on the effect. If I understand correctly, this is all 100% by-the-book: My app has a bunch of capabilities, and individual functions only depend on the effects they need.
However, sometimes I need to handle errors in a function, at the callsite where the effect is used. Perhaps I want to retry reading the file if it fails, or do something else. This doesn't seem possible.
The only way I can think of to get this to work would be to re-run the file-system effect:
But I have to pass Standard exceptions handle this use-case quite gracefully: I can catch errors globally in some app runner, but if I catch them locally, I can handle them. But an effect that can throw Exceptions doesn't immediately tell you which errors can occur, or force you to handle them. What is the right way to do this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Did you have a look at #149? In particular, #149 (comment) might be what you're looking for. |
Beta Was this translation helpful? Give feedback.
Did you have a look at #149? In particular, #149 (comment) might be what you're looking for.