module Signet.Unstable.Exception.VerificationException where

import qualified Control.Monad.Catch as Exception
import qualified Signet.Unstable.Type.Id as Id

newtype VerificationException
  = MkVerificationException Id.Id
  deriving (VerificationException -> VerificationException -> Bool
(VerificationException -> VerificationException -> Bool)
-> (VerificationException -> VerificationException -> Bool)
-> Eq VerificationException
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: VerificationException -> VerificationException -> Bool
== :: VerificationException -> VerificationException -> Bool
$c/= :: VerificationException -> VerificationException -> Bool
/= :: VerificationException -> VerificationException -> Bool
Eq, Int -> VerificationException -> ShowS
[VerificationException] -> ShowS
VerificationException -> String
(Int -> VerificationException -> ShowS)
-> (VerificationException -> String)
-> ([VerificationException] -> ShowS)
-> Show VerificationException
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> VerificationException -> ShowS
showsPrec :: Int -> VerificationException -> ShowS
$cshow :: VerificationException -> String
show :: VerificationException -> String
$cshowList :: [VerificationException] -> ShowS
showList :: [VerificationException] -> ShowS
Show)

instance Exception.Exception VerificationException where
  displayException :: VerificationException -> String
displayException = String -> ShowS
forall a. Monoid a => a -> a -> a
mappend String
"verification failed: " ShowS
-> (VerificationException -> String)
-> VerificationException
-> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Id -> String
forall a. Show a => a -> String
show (Id -> String)
-> (VerificationException -> Id) -> VerificationException -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VerificationException -> Id
unwrap

unwrap :: VerificationException -> Id.Id
unwrap :: VerificationException -> Id
unwrap (MkVerificationException Id
id_) = Id
id_