Safe Haskell | None |
---|---|
Language | Haskell2010 |
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
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 #
ErrorAsException :: forall e. Error e => e -> ErrorAsException |
Instances
Exception ErrorAsException Source # | |
Defined in Cardano.Api.Error | |
Show ErrorAsException Source # | |
Defined in Cardano.Api.Error | |
Error ErrorAsException Source # | |
Defined in Cardano.Api.Error prettyError :: ErrorAsException -> Doc ann Source # |
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 #