I like to forward this message from Haskell-Cafe:
---------- Forwarded message ----------
Date: Fri, 11 Mar 2011 17:04:16 +0100 (CET)
From: Daniel Díaz
To: haskell-cafe@haskell.org
Subject: [Haskell-cafe] Uncatchable error
Hi, cafe,
I'm working in a program where I use many connections with Network.HTTP.
Sometimes, connections are closed while my program is reading them, and an
error appears:
: Data.ByteString.hGetLine: invalid argument (Bad file
descriptor)
All I need is to handle this error. The function 'catch' doesn't work. I
guess this error comes from a call to 'error' function, or something
similar.
What I can do?
Thanks in advance,
Daniel Díaz
_______________________________________________
It sounds to me that this is not a particular problem of Network.HTTP or
Data.ByteString.hGetLine. It would certainly also happen for
System.IO.hGetLine applied to a HTTP stream. So how can exceptions about
closed HTTP connections be caught and where is it documented? The
System.IO functions only mention EOF as possible exception.