- if isEOFError e
- then if not (isEmptyBuffer buf)
- then return (handle_', "\r")
- else return (handle_', "")
- else ioError e
+ let r = if isEOFError e
+ then if not (isEmptyBuffer buf)
+ then "\r"
+ else ""
+ else
+ throw (augmentIOError e "hGetContents" h)
+
+ return (handle_', r)