Check out the spoon package on hackage. It&#39;s designed for these kinds of situations, and will wrap up common user-generated &quot;pure&quot; exceptions into a Maybe (and will return Nothing in the cases you describe)<br>
<br><div>-Dan</div><div><br><div class="gmail_quote">On Fri, Mar 11, 2011 at 11:04 AM, Daniel Díaz <span dir="ltr">&lt;<a href="mailto:danieldiaz@asofilak.es">danieldiaz@asofilak.es</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi, cafe,<br>
<br>
I&#39;m working in a program where I use many connections with Network.HTTP.<br>
Sometimes, connections are closed while my program is reading them, and an<br>
error appears:<br>
<br>
&lt;socket: XXX&gt;: Data.ByteString.hGetLine: invalid argument (Bad file<br>
descriptor)<br>
<br>
All I need is to handle this error. The function &#39;catch&#39; doesn&#39;t work. I<br>
guess this error comes from a call to &#39;error&#39; function, or something<br>
similar.<br>
<br>
What I can do?<br>
<br>
Thanks in advance,<br>
Daniel Díaz<br>
<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">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>
</blockquote></div><br></div>