Safe Haskell | None |
---|---|
Language | Haskell2010 |
Bitgram's general-purpose exceptions. They may be useful when you need a simple instance of Exception (e. g. in MonadThrow context)
Synopsis
- newtype TextException = TextException {}
- throwText :: MonadThrow m => Text -> m a
- data EmptyException = EmptyException
- throwEmpty :: MonadThrow m => m a
- eitherToFail :: (Monad m, e ~ SomeException) => Either e a -> m a
Documentation
newtype TextException Source #
Use this type if you are sure that text description is enough to represent error
Instances
Show TextException Source # | |
Defined in Serokell.Util.Exceptions showsPrec :: Int -> TextException -> ShowS # show :: TextException -> String # showList :: [TextException] -> ShowS # | |
Exception TextException Source # | |
Defined in Serokell.Util.Exceptions | |
Buildable TextException Source # | |
Defined in Serokell.Util.Exceptions build :: TextException -> Builder # |
throwText :: MonadThrow m => Text -> m a Source #
data EmptyException Source #
Use this type if you want to signal about error and there may be only one reason for it
Instances
Show EmptyException Source # | |
Defined in Serokell.Util.Exceptions showsPrec :: Int -> EmptyException -> ShowS # show :: EmptyException -> String # showList :: [EmptyException] -> ShowS # | |
Exception EmptyException Source # | |
Defined in Serokell.Util.Exceptions |
throwEmpty :: MonadThrow m => m a Source #
eitherToFail :: (Monad m, e ~ SomeException) => Either e a -> m a Source #
Convert MonadThrow to arbitrary monad using fail
to report
error Useful when you have MonadThrow
and want to use it in
another monad context which uses fail
for errors