| Copyright | (c) digitally induced GmbH 2020 |
|---|---|
| Safe Haskell | None |
| Language | GHC2021 |
IHP.ErrorController
Description
Synopsis
- displayException :: (Show action, ?context :: ControllerContext, ?request :: Request, ?respond :: Respond) => SomeException -> action -> Text -> IO ResponseReceived
- errorHandlerMiddleware :: FrameworkConfig -> Middleware
- newtype RouterException = RouterException SomeException
- newtype InitContextException = InitContextException SomeException
Documentation
displayException :: (Show action, ?context :: ControllerContext, ?request :: Request, ?respond :: Respond) => SomeException -> action -> Text -> IO ResponseReceived Source #
errorHandlerMiddleware :: FrameworkConfig -> Middleware Source #
Middleware that catches exceptions and displays appropriate error pages.
This middleware should be placed near the top of the middleware stack so it can catch exceptions from controllers, routing, and other middleware.
newtype RouterException Source #
Wrapper for exceptions that occur during routing. This allows the error handler middleware to distinguish routing errors from action errors and display appropriate error messages.
Constructors
| RouterException SomeException |
Instances
| Exception RouterException Source # | |
Defined in IHP.ErrorController Methods toException :: RouterException -> SomeException # fromException :: SomeException -> Maybe RouterException # displayException :: RouterException -> String # backtraceDesired :: RouterException -> Bool # | |
| Show RouterException Source # | |
Defined in IHP.ErrorController Methods showsPrec :: Int -> RouterException -> ShowS # show :: RouterException -> String # showList :: [RouterException] -> ShowS # | |
newtype InitContextException Source #
Wrapper for exceptions that occur during initContext.
This allows the error handler middleware to show "while calling initContext"
in the error message, helping developers locate the source of the problem.
Constructors
| InitContextException SomeException |
Instances
| Exception InitContextException Source # | |
Defined in IHP.ErrorController | |
| Show InitContextException Source # | |
Defined in IHP.ErrorController Methods showsPrec :: Int -> InitContextException -> ShowS # show :: InitContextException -> String # showList :: [InitContextException] -> ShowS # | |