Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Common exceptions
Synopsis
- newtype AlreadyExists entity = AlreadyExists entity
- data DivideByZero = DivideByZero
- newtype InvalidFormat entity = InvalidFormat entity
- data NotAllowed user entity = NotAllowed {}
- data NotFound entity = NotFound
- newtype OutOfBounds entity index = OutOfBounds index
- data WithMessage err = !err `WithMessage` !Text
Documentation
newtype AlreadyExists entity Source #
Requested entity already exists; a conflict
AlreadyExists entity |
Instances
Functor AlreadyExists Source # | |
Defined in Data.Exception.Types fmap :: (a -> b) -> AlreadyExists a -> AlreadyExists b # (<$) :: a -> AlreadyExists b -> AlreadyExists a # | |
Eq entity => Eq (AlreadyExists entity) Source # | |
Defined in Data.Exception.Types (==) :: AlreadyExists entity -> AlreadyExists entity -> Bool # (/=) :: AlreadyExists entity -> AlreadyExists entity -> Bool # | |
Show entity => Show (AlreadyExists entity) Source # | |
Defined in Data.Exception.Types showsPrec :: Int -> AlreadyExists entity -> ShowS # show :: AlreadyExists entity -> String # showList :: [AlreadyExists entity] -> ShowS # |
data DivideByZero Source #
Arithmetic divide by zero error
Instances
Eq DivideByZero Source # | |
Defined in Data.Exception.Types (==) :: DivideByZero -> DivideByZero -> Bool # (/=) :: DivideByZero -> DivideByZero -> Bool # | |
Show DivideByZero Source # | |
Defined in Data.Exception.Types showsPrec :: Int -> DivideByZero -> ShowS # show :: DivideByZero -> String # showList :: [DivideByZero] -> ShowS # |
newtype InvalidFormat entity Source #
Invalid format for entity (e.g. bad JSON)
InvalidFormat entity |
Instances
Functor InvalidFormat Source # | |
Defined in Data.Exception.Types fmap :: (a -> b) -> InvalidFormat a -> InvalidFormat b # (<$) :: a -> InvalidFormat b -> InvalidFormat a # | |
Eq entity => Eq (InvalidFormat entity) Source # | |
Defined in Data.Exception.Types (==) :: InvalidFormat entity -> InvalidFormat entity -> Bool # (/=) :: InvalidFormat entity -> InvalidFormat entity -> Bool # | |
Show entity => Show (InvalidFormat entity) Source # | |
Defined in Data.Exception.Types showsPrec :: Int -> InvalidFormat entity -> ShowS # show :: InvalidFormat entity -> String # showList :: [InvalidFormat entity] -> ShowS # |
data NotAllowed user entity Source #
Action not allowed by user
Instances
(Eq user, Eq entity) => Eq (NotAllowed user entity) Source # | |
Defined in Data.Exception.Types (==) :: NotAllowed user entity -> NotAllowed user entity -> Bool # (/=) :: NotAllowed user entity -> NotAllowed user entity -> Bool # | |
(Show user, Show entity) => Show (NotAllowed user entity) Source # | |
Defined in Data.Exception.Types showsPrec :: Int -> NotAllowed user entity -> ShowS # show :: NotAllowed user entity -> String # showList :: [NotAllowed user entity] -> ShowS # |
newtype OutOfBounds entity index Source #
Requested index is out of bounds
OutOfBounds index |
Instances
Functor (OutOfBounds entity) Source # | |
Defined in Data.Exception.Types fmap :: (a -> b) -> OutOfBounds entity a -> OutOfBounds entity b # (<$) :: a -> OutOfBounds entity b -> OutOfBounds entity a # | |
Eq index => Eq (OutOfBounds entity index) Source # | |
Defined in Data.Exception.Types (==) :: OutOfBounds entity index -> OutOfBounds entity index -> Bool # (/=) :: OutOfBounds entity index -> OutOfBounds entity index -> Bool # | |
Show index => Show (OutOfBounds entity index) Source # | |
Defined in Data.Exception.Types 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
>>>
:set -XOverloadedStrings
>>>
show $ InvalidFormat "foo" `WithMessage` "Not a valid JSON object"
"InvalidFormat \"foo\" `WithMessage` \"Not a valid JSON object\""
!err `WithMessage` !Text |
Instances
Functor WithMessage Source # | |
Defined in Data.Exception.Types fmap :: (a -> b) -> WithMessage a -> WithMessage b # (<$) :: a -> WithMessage b -> WithMessage a # | |
Eq err => Eq (WithMessage err) Source # | |
Defined in Data.Exception.Types (==) :: WithMessage err -> WithMessage err -> Bool # (/=) :: WithMessage err -> WithMessage err -> Bool # | |
Show err => Show (WithMessage err) Source # | |
Defined in Data.Exception.Types showsPrec :: Int -> WithMessage err -> ShowS # show :: WithMessage err -> String # showList :: [WithMessage err] -> ShowS # |