-import System.IO
-import Text.Printf
-
-import Debug.Trace
-
-
-responseWriter :: Handle -> InteractionQueue -> IO ()
-responseWriter h tQueue
- = catch awaitSomethingToWrite $ \ exc ->
- case exc of
- IOException _ -> return ()
- _ -> print exc
+import System.IO (stderr)
+
+
+responseWriter :: HandleLike h => Config -> h -> InteractionQueue -> ThreadId -> IO ()
+responseWriter !cnf !h !tQueue !readerTID
+ = awaitSomethingToWrite
+ `catches`
+ [ Handler (( \ _ -> return () ) :: IOException -> IO ())
+ , Handler ( \ ThreadKilled -> return () )
+ , Handler ( \ BlockedIndefinitelyOnSTM -> hPutStrLn stderr "requestWriter: blocked indefinitely" )
+ , Handler (( \ e -> hPutStrLn stderr (show e) ) :: SomeException -> IO ())
+ ]