| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Cardano.Api.Error
Description
Class of errors used in the Api.
Synopsis
- class Error e where
- prettyError :: e -> Doc ann
- throwErrorM :: (HasCallStack, MonadThrow m, Typeable e, Error e) => e -> m a
- liftEitherError :: (HasCallStack, MonadThrow m, Typeable e, Error e) => Either e a -> m a
- failEitherError :: (MonadFail m, Error e) => Either e a -> m a
- data ErrorAsException where
- ErrorAsException :: forall e. (HasCallStack, Typeable e, Error e) => e -> ErrorAsException
- data FileError e
- fileIOExceptT :: forall (m :: Type -> Type) s e. MonadIO m => FilePath -> (FilePath -> IO s) -> ExceptT (FileError e) m s
- displayError :: Error a => a -> String
- renderBuildable :: Buildable a => a -> Text
Documentation
Methods
prettyError :: e -> Doc ann Source #
Instances
throwErrorM :: (HasCallStack, MonadThrow m, Typeable e, Error e) => e -> m a Source #
Throw an 'Error e' as ErrorAsException. throwErrorM will attach a call stack to the exception.
liftEitherError :: (HasCallStack, MonadThrow m, Typeable e, Error e) => Either e a -> m a Source #
Pretty print 'Error e' and throwM it wrapped in ErrorAsException when Left.
data ErrorAsException where Source #
An exception wrapping any 'Error e', attaching a call stack from the construction place to it.
Constructors
| ErrorAsException :: forall e. (HasCallStack, Typeable e, Error e) => e -> ErrorAsException |
Instances
| Error ErrorAsException Source # | Pretty print the error inside the exception |
Defined in Cardano.Api.Error Methods prettyError :: ErrorAsException -> Doc ann Source # | |
| Exception ErrorAsException Source # | |
Defined in Cardano.Api.Error Methods toException :: ErrorAsException -> SomeException Source # fromException :: SomeException -> Maybe ErrorAsException Source # | |
| Show ErrorAsException Source # | Pretty print the error inside the exception followed by the call stack pointing to the place where 'Error e' was
wrapped in |
Defined in Cardano.Api.Error | |
Constructors
| FileError FilePath e | |
| FileErrorTempFile | |
| FileDoesNotExistError FilePath | |
| FileIOError FilePath IOException | |
fileIOExceptT :: forall (m :: Type -> Type) s e. MonadIO m => FilePath -> (FilePath -> IO s) -> ExceptT (FileError e) m s Source #
displayError :: Error a => a -> String Source #
renderBuildable :: Buildable a => a -> Text Source #