diff options
-rw-r--r-- | libraries/base/GHC/IO/Handle/Text.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libraries/base/GHC/IO/Handle/Text.hs b/libraries/base/GHC/IO/Handle/Text.hs index de48bf44ae..88ec3c4e67 100644 --- a/libraries/base/GHC/IO/Handle/Text.hs +++ b/libraries/base/GHC/IO/Handle/Text.hs @@ -389,8 +389,11 @@ lazyRead handle = unsafeInterleaveIO $ withHandle "hGetContents" handle $ \ handle_ -> do case haType handle_ of - ClosedHandle -> return (handle_, "") SemiClosedHandle -> lazyReadBuffered handle handle_ + ClosedHandle + -> ioException + (IOError (Just handle) IllegalOperation "hGetContents" + "delayed read on closed handle" Nothing Nothing) _ -> ioException (IOError (Just handle) IllegalOperation "hGetContents" "illegal handle type" Nothing Nothing) |