{-|
Module: IHP.Router.Types
Copyright: (c) digitally induced GmbH, 2020
-}
module IHP.Router.Types where

import IHP.Prelude

-- | Thrown when 'IHP.RouterSupport.parseUUIDArgument', 'IHP.RouterSupport.parseIntArgument', etc. get passed an invalid value
--
-- Let's say we have a @ShowProjectAction { id :: Id Project }@.
--
-- When opening @/ShowProject?projectId=ab55d579-80cd-4608-9a8f-c76dea6c2332@ everything is fine.
-- But when opening @/ShowProject?projectId=not-an-uuid@ this exception will be thrown.
data InvalidActionArgumentException = InvalidActionArgumentException
        { InvalidActionArgumentException -> ByteString
expectedType :: !ByteString
        , InvalidActionArgumentException -> ByteString
value :: !ByteString
        , InvalidActionArgumentException -> ByteString
field :: !ByteString
        } deriving (InvalidActionArgumentException
-> InvalidActionArgumentException -> Bool
(InvalidActionArgumentException
 -> InvalidActionArgumentException -> Bool)
-> (InvalidActionArgumentException
    -> InvalidActionArgumentException -> Bool)
-> Eq InvalidActionArgumentException
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InvalidActionArgumentException
-> InvalidActionArgumentException -> Bool
$c/= :: InvalidActionArgumentException
-> InvalidActionArgumentException -> Bool
== :: InvalidActionArgumentException
-> InvalidActionArgumentException -> Bool
$c== :: InvalidActionArgumentException
-> InvalidActionArgumentException -> Bool
Eq, Int -> InvalidActionArgumentException -> ShowS
[InvalidActionArgumentException] -> ShowS
InvalidActionArgumentException -> String
(Int -> InvalidActionArgumentException -> ShowS)
-> (InvalidActionArgumentException -> String)
-> ([InvalidActionArgumentException] -> ShowS)
-> Show InvalidActionArgumentException
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InvalidActionArgumentException] -> ShowS
$cshowList :: [InvalidActionArgumentException] -> ShowS
show :: InvalidActionArgumentException -> String
$cshow :: InvalidActionArgumentException -> String
showsPrec :: Int -> InvalidActionArgumentException -> ShowS
$cshowsPrec :: Int -> InvalidActionArgumentException -> ShowS
Show)

instance Exception InvalidActionArgumentException