on master help sign in
removing onE.
commit82109e0185c32581a3944e8d2021429fc7193bde authorKazu Yamamoto <kazu@iij.ad.jp> dateWed 17 Jun 2015, 21:49 (11 years ago) parent3a73a15
1 file changed+4−7
warp/Network/Wai/Handler/Warp/Run.hs+4−7
warp/Network/Wai/Handler/Warp/Run.hs+4−7
@@ -178,9 +178,6 @@ runSettingsConnectionMakerSecure set getConnMaker app = do
178178 T.stopManager
179179 f
180180
181−onE :: Settings -> Maybe Request -> SomeException -> IO ()
182−onE set mreq e = settingsOnException set mreq e
183−
184181-- Note that there is a thorough discussion of the exception safety of the
185182-- following code at: https://github.com/yesodweb/wai/issues/146
186183--
@@ -232,7 +229,7 @@ acceptConnection set getConnMaker app dc fc tm counter = do
232229 case ex of
233230 Right x -> return $ Just x
234231 Left e -> do
235− onE set Nothing $ toException e
232+ settingsOnException set Nothing $ toException e
236233 if isFullErrorType (ioeGetErrorType e) then do
237234 -- "resource exhausted (Too many open files)" may
238235 -- happen by accept(). Wait a second hoping that
@@ -278,7 +275,7 @@ fork set mkConn addr app dc fc tm counter = settingsFork set $ \ unmask ->
278275 in unmask .
279276 -- Call the user-supplied on exception code if any
280277 -- exceptions are thrown.
281− handle (onE set Nothing) .
278+ handle (settingsOnException set Nothing) .
282279
283280 -- Call the user-supplied code for connection open and close events
284281 bracket (onOpen addr) (onClose addr) $ \goingon ->
@@ -368,8 +365,8 @@ serveConnection conn ii origAddr transport settings app = do
368365 `E.catch` \e -> do
369366 -- Call the user-supplied exception handlers, passing the request.
370367 sendErrorResponse addr istatus e
371− onE settings (Just req) e
372− -- Don't throw the error again to prevent calling onE twice.
368+ settingsOnException settings (Just req) e
369+ -- Don't throw the error again to prevent calling settingsOnException twice.
373370 return False
374371 when keepAlive $ http1 addr istatus src
375372