Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- class Monad m => MonadThrow (m :: Type -> Type) where
- throwM :: (HasCallStack, Exception e) => e -> m a
- data NoMatch = NoMatch
- data SomethingWentWrong = SomethingWentWrong
- data ServerError = ServerError {}
- data ErrorBuilders = ErrorBuilders {}
- type ErrorBuilder = Request -> Status -> ByteString -> ServerError
- type TextToError = ByteString -> ServerError
- codeOf :: ServerError -> Status
- unauthorized :: ServerError
- redirect :: MonadThrow m => ByteString -> m a
- found :: ServerError
- err300 :: ServerError
- err301 :: ServerError
- err302 :: ServerError
- err303 :: ServerError
- err304 :: ServerError
- err305 :: ServerError
- err307 :: ServerError
- err400 :: ServerError
- err401 :: ServerError
- err402 :: ServerError
- err403 :: ServerError
- err404 :: ServerError
- err405 :: ServerError
- err406 :: ServerError
- err407 :: ServerError
- err409 :: ServerError
- err410 :: ServerError
- err411 :: ServerError
- err412 :: ServerError
- err413 :: ServerError
- err414 :: ServerError
- err415 :: ServerError
- err416 :: ServerError
- err417 :: ServerError
- err418 :: ServerError
- err422 :: ServerError
- err500 :: ServerError
- err501 :: ServerError
- err502 :: ServerError
- err503 :: ServerError
- err504 :: ServerError
- err505 :: ServerError
- multipleChoices :: ServerError
- movedPermanently :: ServerError
- seeOther :: ServerError
- notModified :: ServerError
- useProxy :: ServerError
- temporaryRedirect :: ServerError
- badRequest :: ServerError
- paymentRequired :: ServerError
- forbidden :: ServerError
- notFound :: ServerError
- methodNotAllowed :: ServerError
- notAcceptable :: ServerError
- proxyAuthenticationRequired :: ServerError
- conflict :: ServerError
- gone :: ServerError
- lengthRequired :: ServerError
- preconditionFailed :: ServerError
- requestEntityTooLarge :: ServerError
- requestURITooLong :: ServerError
- unsupportedMediaType :: ServerError
- requestedRangeNotSatisfiable :: ServerError
- expectationFailed :: ServerError
- teapot :: ServerError
- unprocessableEntity :: ServerError
- internalServerError :: ServerError
- notImplemented :: ServerError
- badGateway :: ServerError
- serviceUnavailable :: ServerError
- gatewayTimeout :: ServerError
- httpVersionNotSupported :: ServerError
Documentation
class Monad m => MonadThrow (m :: Type -> Type) where #
A class for monads in which exceptions may be thrown.
Instances should obey the following law:
throwM e >> x = throwM e
In other words, throwing an exception short-circuits the rest of the monadic computation.
throwM :: (HasCallStack, Exception e) => e -> m a #
Throw an exception. Note that this throws when this action is run in
the monad m
, not when it is applied. It is a generalization of
Control.Exception's throwIO
.
Should satisfy the law:
throwM e >> f = throwM e
Instances
Instances
Exception NoMatch Source # | |
Defined in Web.Minion.Error toException :: NoMatch -> SomeException # fromException :: SomeException -> Maybe NoMatch # displayException :: NoMatch -> String # | |
Show NoMatch Source # | |
data SomethingWentWrong Source #
Instances
Exception SomethingWentWrong Source # | |
Defined in Web.Minion.Error | |
Show SomethingWentWrong Source # | |
Defined in Web.Minion.Error showsPrec :: Int -> SomethingWentWrong -> ShowS # show :: SomethingWentWrong -> String # showList :: [SomethingWentWrong] -> ShowS # |
data ServerError Source #
Instances
Exception ServerError Source # | |
Defined in Web.Minion.Error | |
Show ServerError Source # | |
Defined in Web.Minion.Error showsPrec :: Int -> ServerError -> ShowS # show :: ServerError -> String # showList :: [ServerError] -> ShowS # |
data ErrorBuilders Source #
type ErrorBuilder = Request -> Status -> ByteString -> ServerError Source #
type TextToError = ByteString -> ServerError Source #
codeOf :: ServerError -> Status Source #
redirect :: MonadThrow m => ByteString -> m a Source #
found :: ServerError Source #
err300 :: ServerError Source #
err301 :: ServerError Source #
err302 :: ServerError Source #
err303 :: ServerError Source #
err304 :: ServerError Source #
err305 :: ServerError Source #
err307 :: ServerError Source #
err400 :: ServerError Source #
err401 :: ServerError Source #
err402 :: ServerError Source #
err403 :: ServerError Source #
err404 :: ServerError Source #
err405 :: ServerError Source #
err406 :: ServerError Source #
err407 :: ServerError Source #
err409 :: ServerError Source #
err410 :: ServerError Source #
err411 :: ServerError Source #
err412 :: ServerError Source #
err413 :: ServerError Source #
err414 :: ServerError Source #
err415 :: ServerError Source #
err416 :: ServerError Source #
err417 :: ServerError Source #
err418 :: ServerError Source #
err422 :: ServerError Source #
err500 :: ServerError Source #
err501 :: ServerError Source #
err502 :: ServerError Source #
err503 :: ServerError Source #
err504 :: ServerError Source #
err505 :: ServerError Source #
gone :: ServerError Source #
teapot :: ServerError Source #