rescue-0.4.2.1: More understandable exceptions
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Exception.Types

Description

Common exceptions

Synopsis

Documentation

newtype AlreadyExists entity Source #

Requested entity already exists; a conflict

Constructors

AlreadyExists entity 

Instances

Instances details
Functor AlreadyExists Source # 
Instance details

Defined in Data.Exception.Types

Methods

fmap :: (a -> b) -> AlreadyExists a -> AlreadyExists b #

(<$) :: a -> AlreadyExists b -> AlreadyExists a #

Eq entity => Eq (AlreadyExists entity) Source # 
Instance details

Defined in Data.Exception.Types

Methods

(==) :: AlreadyExists entity -> AlreadyExists entity -> Bool #

(/=) :: AlreadyExists entity -> AlreadyExists entity -> Bool #

Show entity => Show (AlreadyExists entity) Source # 
Instance details

Defined in Data.Exception.Types

Methods

showsPrec :: Int -> AlreadyExists entity -> ShowS #

show :: AlreadyExists entity -> String #

showList :: [AlreadyExists entity] -> ShowS #

data DivideByZero Source #

Arithmetic divide by zero error

Constructors

DivideByZero 

Instances

Instances details
Eq DivideByZero Source # 
Instance details

Defined in Data.Exception.Types

Show DivideByZero Source # 
Instance details

Defined in Data.Exception.Types

newtype InvalidFormat entity Source #

Invalid format for entity (e.g. bad JSON)

Constructors

InvalidFormat entity 

Instances

Instances details
Functor InvalidFormat Source # 
Instance details

Defined in Data.Exception.Types

Methods

fmap :: (a -> b) -> InvalidFormat a -> InvalidFormat b #

(<$) :: a -> InvalidFormat b -> InvalidFormat a #

Eq entity => Eq (InvalidFormat entity) Source # 
Instance details

Defined in Data.Exception.Types

Methods

(==) :: InvalidFormat entity -> InvalidFormat entity -> Bool #

(/=) :: InvalidFormat entity -> InvalidFormat entity -> Bool #

Show entity => Show (InvalidFormat entity) Source # 
Instance details

Defined in Data.Exception.Types

Methods

showsPrec :: Int -> InvalidFormat entity -> ShowS #

show :: InvalidFormat entity -> String #

showList :: [InvalidFormat entity] -> ShowS #

data NotAllowed user entity Source #

Action not allowed by user

Constructors

NotAllowed 

Fields

Instances

Instances details
(Eq user, Eq entity) => Eq (NotAllowed user entity) Source # 
Instance details

Defined in Data.Exception.Types

Methods

(==) :: NotAllowed user entity -> NotAllowed user entity -> Bool #

(/=) :: NotAllowed user entity -> NotAllowed user entity -> Bool #

(Show user, Show entity) => Show (NotAllowed user entity) Source # 
Instance details

Defined in Data.Exception.Types

Methods

showsPrec :: Int -> NotAllowed user entity -> ShowS #

show :: NotAllowed user entity -> String #

showList :: [NotAllowed user entity] -> ShowS #

data NotFound entity Source #

Entity not found

Constructors

NotFound 

Instances

Instances details
Eq (NotFound entity) Source # 
Instance details

Defined in Data.Exception.Types

Methods

(==) :: NotFound entity -> NotFound entity -> Bool #

(/=) :: NotFound entity -> NotFound entity -> Bool #

Show (NotFound entity) Source # 
Instance details

Defined in Data.Exception.Types

Methods

showsPrec :: Int -> NotFound entity -> ShowS #

show :: NotFound entity -> String #

showList :: [NotFound entity] -> ShowS #

newtype OutOfBounds entity index Source #

Requested index is out of bounds

Constructors

OutOfBounds index 

Instances

Instances details
Functor (OutOfBounds entity) Source # 
Instance details

Defined in Data.Exception.Types

Methods

fmap :: (a -> b) -> OutOfBounds entity a -> OutOfBounds entity b #

(<$) :: a -> OutOfBounds entity b -> OutOfBounds entity a #

Eq index => Eq (OutOfBounds entity index) Source # 
Instance details

Defined in Data.Exception.Types

Methods

(==) :: OutOfBounds entity index -> OutOfBounds entity index -> Bool #

(/=) :: OutOfBounds entity index -> OutOfBounds entity index -> Bool #

Show index => Show (OutOfBounds entity index) Source # 
Instance details

Defined in Data.Exception.Types

Methods

showsPrec :: Int -> OutOfBounds entity index -> ShowS #

show :: OutOfBounds entity index -> String #

showList :: [OutOfBounds entity index] -> ShowS #

data WithMessage err Source #

Attach a message to an exception, typicaly for runtime user feedback

Examples

Expand
>>> :set -XOverloadedStrings
>>> show $ InvalidFormat "foo" `WithMessage` "Not a valid JSON object"
"InvalidFormat \"foo\" `WithMessage` \"Not a valid JSON object\""

Constructors

!err `WithMessage` !Text 

Instances

Instances details
Functor WithMessage Source # 
Instance details

Defined in Data.Exception.Types

Methods

fmap :: (a -> b) -> WithMessage a -> WithMessage b #

(<$) :: a -> WithMessage b -> WithMessage a #

Eq err => Eq (WithMessage err) Source # 
Instance details

Defined in Data.Exception.Types

Methods

(==) :: WithMessage err -> WithMessage err -> Bool #

(/=) :: WithMessage err -> WithMessage err -> Bool #

Show err => Show (WithMessage err) Source # 
Instance details

Defined in Data.Exception.Types

Methods

showsPrec :: Int -> WithMessage err -> ShowS #

show :: WithMessage err -> String #

showList :: [WithMessage err] -> ShowS #