module Signet.Unstable.Exception.InvalidSecretKey where

import qualified Control.Monad.Catch as Exception
import qualified Data.ByteString as ByteString

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

instance Exception.Exception InvalidSecretKey where
  displayException :: InvalidSecretKey -> String
displayException = String -> ShowS
forall a. Monoid a => a -> a -> a
mappend String
"invalid secret key: " ShowS -> (InvalidSecretKey -> String) -> InvalidSecretKey -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ByteString -> String
forall a. Show a => a -> String
show (ByteString -> String)
-> (InvalidSecretKey -> ByteString) -> InvalidSecretKey -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. InvalidSecretKey -> ByteString
unwrap

unwrap :: InvalidSecretKey -> ByteString.ByteString
unwrap :: InvalidSecretKey -> ByteString
unwrap (MkInvalidSecretKey ByteString
byteString) = ByteString
byteString