@@ -138,9 +138,18 @@ setOnException :: (Maybe Request -> SomeException -> IO ()) -> Settings -> Setti
138setOnException x y = y { settingsOnException = x }
138setOnException x y = y { settingsOnException = x }
140-- | A function to create a `Response` when an exception occurs.
140-- | A function to create a `Response` when an exception occurs.
142-- Default: 'defaultOnExceptionResponse'
141-- Default: 'defaultOnExceptionResponse'
143+-- Note that an application can handle its own exceptions without interfering with Warp:
145+-- > myApp :: Application
146+-- > myApp request respond = innerApp `catch` onError
148+-- > onError = respond . response500 request
150+-- > response500 :: Request -> SomeException -> Response
151+-- > response500 req someEx = responseLBS status500 -- ...
144-- Since 2.1.0
153-- Since 2.1.0
145setOnExceptionResponse :: (SomeException -> Response) -> Settings -> Settings
154setOnExceptionResponse :: (SomeException -> Response) -> Settings -> Settings
146setOnExceptionResponse x y = y { settingsOnExceptionResponse = x }
155setOnExceptionResponse x y = y { settingsOnExceptionResponse = x }