Skip to content

Commit

Permalink
delete unused ExceptionInsideResponseBody exception
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellwrosen committed Dec 21, 2023
1 parent a1dee2e commit 871e158
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
10 changes: 4 additions & 6 deletions warp/Network/Wai/Handler/Warp/HTTP1.hs
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,10 @@ processRequest settings ii conn app th istatus src req mremainingRef idxhdr next
return ResponseReceived
case r of
Right ResponseReceived -> return ()
Left (e :: SomeException)
| Just (ExceptionInsideResponseBody e') <- fromException e -> throwIO e'
| otherwise -> do
keepAlive <- sendErrorResponse settings ii conn th istatus req e
settingsOnException settings (Just req) e
writeIORef keepAliveRef keepAlive
Left e -> do
keepAlive <- sendErrorResponse settings ii conn th istatus req e
settingsOnException settings (Just req) e
writeIORef keepAliveRef keepAlive

keepAlive <- readIORef keepAliveRef

Expand Down
14 changes: 0 additions & 14 deletions warp/Network/Wai/Handler/Warp/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,6 @@ instance UnliftIO.Exception InvalidRequest

----------------------------------------------------------------

-- | Exception thrown if something goes wrong while in the midst of
-- sending a response, since the status code can't be altered at that
-- point.
--
-- Used to determine whether keeping the HTTP1.1 connection / HTTP2 stream alive is safe
-- or irrecoverable.

newtype ExceptionInsideResponseBody = ExceptionInsideResponseBody UnliftIO.SomeException
deriving (Show, Typeable)

instance UnliftIO.Exception ExceptionInsideResponseBody

----------------------------------------------------------------

-- | Data type to abstract file identifiers.
-- On Unix, a file descriptor would be specified to make use of
-- the file descriptor cache.
Expand Down

0 comments on commit 871e158

Please sign in to comment.