@@ -5,7 +5,7 @@
55module Network.Wai.Handler.Warp.Run where
66
77import Control.Concurrent (threadDelay, forkIOWithUnmask)
8−import Control.Exception
8+import Control.Exception as E
99import Control.Monad (forever, when, unless, void)
1010import Control.Monad.IO.Class (MonadIO, liftIO)
1111import Control.Monad.Trans.Class (lift)
@@ -27,7 +27,6 @@ import Network.Wai.Handler.Warp.Response
2727import Network.Wai.Handler.Warp.Settings
2828import qualified Network.Wai.Handler.Warp.Timeout as T
2929import Network.Wai.Handler.Warp.Types
30−import Prelude hiding (catch)
3130
3231-- Sock.recv first tries to call recvfrom() optimistically.
3332-- If EAGAIN returns, it polls incoming data with epoll/kqueue.
@@ -212,7 +211,7 @@ runSettingsConnectionMaker set getConn app = do
212211 serveConnection th set cleaner port app conn addr
213212 where
214213 -- FIXME: only IOEception is caught. What about other exceptions?
215− getConnLoop = getConn `catch` \(e :: IOException) -> do
214+ getConnLoop = getConn `E.catch` \(e :: IOException) -> do
216215 onE (toException e)
217216 -- "resource exhausted (Too many open files)" may happen by accept().
218217 -- Wait a second hoping that resource will be available.
@@ -270,7 +269,7 @@ serveConnection timeoutHandle settings cleaner port app conn remoteHost' =
270269 intercept fromClient' conn
271270
272271respondOnException :: Settings -> Cleaner -> Connection -> SockAddr -> IO () -> IO ()
273−respondOnException settings cleaner conn remoteHost' io = io `catch` \e@(SomeException _) -> do
272+respondOnException settings cleaner conn remoteHost' io = io `E.catch` \e@(SomeException _) -> do
274273 _ <- runResourceT $ sendResponse settings cleaner blankRequest conn internalError
275274 throwIO e
276275 where