<div dir="ltr"><p><br>
On Nov 5, 2012 2:42 PM, "Hiromi ISHII" <<a href="mailto:konn.jinro@gmail.com" target="_blank">konn.jinro@gmail.com</a>> wrote:<br>
><br>
> Hi, there<br>
><br>
> On 2012/11/01, at 21:23, Michael Snoyman wrote:<br>
><br>
> > Due to various technical reasons regarding the nature of conduit, you can't currently catch exceptions within the Pipe monad. You have two options:<br>
> ><br>
> > * Catch exceptions before `lift`ing.<br>
> > * Catch exceptions thrown from the entire Pipe.<br>
> ><br>
> > Since the exceptions are always originating in the underlying monad, the first choice is certainly possible in theory, though may require reworking the library you're using a bit.<br>
><br>
> Thanks. In my case, used library is relatively small so I can rewrite it to ignore exception before lifting.<br>
> But I think it is more convenient doing the same thing without modifying existing code.<br>
><br>
> The second choice does not match my case because it cannot resume the process from the place just after an exception occurred.</p>
<p>I agree that it would be great if conduit could meet your use case better. I haven't spent enough cycles looking at this yet to determine if the reason we don't have this support is a limitation in the conduit approach itself, or just a limitation in what I was able to implement so far. If you can think of a way to implement more fine-grained exception handling (or anyone else for that matter), I'd love to hear about it.</p>
<p>> > One other possibility that I haven't actually tried would be to use transPipe[1] to catch all of the exceptions, though I'm not sure how well that would work in practice.<br>
><br>
> The type of the first argument of `transPipe` should be general, so I think we can't compose it with `catch` function.<br><br>That makes sense.<br><br>
> -- Hiromi ISHII<br>
> <a href="mailto:konn.jinro@gmail.com" target="_blank">konn.jinro@gmail.com</a><br>
><br>
><br>
><br>
><br>
> _______________________________________________<br>
> Haskell-Cafe mailing list<br>
> <a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
> <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</p>
</div>