Safe Haskell | None |
---|---|
Language | Haskell2010 |
Cardano.Api.Internal.Error
Description
Class of errors used in the Api.
Synopsis
- class Error e where
- prettyError :: e -> Doc ann
- throwErrorAsException :: Error e => e -> IO a
- data ErrorAsException where
- ErrorAsException :: forall 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
Documentation
Methods
prettyError :: e -> Doc ann Source #
Instances
throwErrorAsException :: Error e => e -> IO a Source #
The preferred approach is to use Except
or ExceptT
, but you can if
necessary use IO exceptions.
data ErrorAsException where Source #
Constructors
ErrorAsException :: forall e. Error e => e -> ErrorAsException |
Instances
Exception ErrorAsException Source # | |
Defined in Cardano.Api.Internal.Error Methods toException :: ErrorAsException -> SomeException Source # fromException :: SomeException -> Maybe ErrorAsException Source # | |
Show ErrorAsException Source # | |
Defined in Cardano.Api.Internal.Error | |
Error ErrorAsException Source # | |
Defined in Cardano.Api.Internal.Error Methods prettyError :: ErrorAsException -> Doc ann Source # |
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 #