b9-2.1.0: A tool and library for building virtual machine images.

Safe HaskellNone
LanguageHaskell2010

B9.B9Error

Description

Error handling in B9 via extensible effects. B9 wraps errors in SomeException.

Since: 0.5.64

Synopsis

Documentation

throwSomeException :: (Member ExcB9 e, Exception x) => x -> Eff e a Source #

SomeException wrapped into Excecption Effects

Since: 0.5.64

throwSomeException_ :: (Member ExcB9 e, Exception x) => x -> Eff e () Source #

SomeException wrapped into Excecption Effects

Since: 0.5.64

throwB9Error :: Member ExcB9 e => String -> Eff e a Source #

SomeException wrapped into Excecption Effects

Since: 0.5.64

throwB9Error_ :: Member ExcB9 e => String -> Eff e () Source #

SomeException wrapped into Excecption Effects

Since: 0.5.64

errorOnException :: Lifted IO e => Eff (ExcB9 ': e) a -> Eff e a Source #

Run an ExcB9 and rethrow the exception with error.

Since: 0.5.64

type ExcB9 = Exc SomeException Source #

The exception effect used in most places in B9. This is Exc specialized with SomeException.

Since: 0.5.64

type WithIoExceptions e = SetMember Exc (Exc SomeException) e Source #

Constraint alias for the exception effect that allows to throw SomeException.

Since: 1.0.0

runExcB9 :: Eff (ExcB9 ': e) a -> Eff e (Either SomeException a) Source #

Run an ExcB9.

Since: 0.5.64

newtype B9Error Source #

This is a simple runtime exception to indicate that B9 code encountered some exceptional event.

Since: 0.5.64

Constructors

MkB9Error String 
Instances
Show B9Error Source # 
Instance details

Defined in B9.B9Error

IsString B9Error Source # 
Instance details

Defined in B9.B9Error

Methods

fromString :: String -> B9Error #

Exception B9Error Source # 
Instance details

Defined in B9.B9Error

catchB9Error :: Member ExcB9 e => Eff e a -> (SomeException -> Eff e a) -> Eff e a Source #

Catch exceptions.

Since: 0.5.64

catchB9ErrorAsEither :: Member ExcB9 e => Eff e a -> Eff e (Either SomeException a) Source #

Catch exceptions and return them via Either.

Since: 0.5.64

finallyB9 :: Member ExcB9 e => Eff e a -> Eff e () -> Eff e a Source #

Always execute an action and rethrow any exceptions caught.

Since: 1.0.0