| Copyright | (c) 2023-2024 Apotheca Labs (c) 2024-2025 Haskell Foundation |
|---|---|
| License | BSD-3-Clause |
| Maintainer | joris@well-typed.com, leo@apotheca.io |
| Stability | experimental |
| Portability | POSIX |
| Safe Haskell | Safe-Inferred |
| Language | GHC2021 |
Botan.Low.Error
Description
This module is based on the Return codes section of the C Botan FFI documentation.
Synopsis
- data BotanErrorCode
- botanErrorDescription :: BotanErrorCode -> IO ByteString
- newtype BotanErrorMessage = BotanErrorMessage ByteString
- botanErrorLastExceptionMessage :: IO BotanErrorMessage
- data SomeBotanException = forall e.Exception e => SomeBotanException e
- toBotanException :: Exception e => e -> SomeException
- fromBotanException :: Exception e => SomeException -> Maybe e
- data InvalidInputException = InvalidInputException BotanErrorCode BotanErrorMessage CallStack
- data BadMACException = BadMACException BotanErrorCode BotanErrorMessage CallStack
- data InsufficientBufferSpaceException = InsufficientBufferSpaceException BotanErrorCode BotanErrorMessage CallStack
- data StringConversionException = StringConversionException BotanErrorCode BotanErrorMessage CallStack
- data ExceptionThrownException = ExceptionThrownException BotanErrorCode BotanErrorMessage CallStack
- data OutOfMemoryException = OutOfMemoryException BotanErrorCode BotanErrorMessage CallStack
- data SystemErrorException = SystemErrorException BotanErrorCode BotanErrorMessage CallStack
- data InternalErrorException = InternalErrorException BotanErrorCode BotanErrorMessage CallStack
- data BadFlagException = BadFlagException BotanErrorCode BotanErrorMessage CallStack
- data NullPointerException = NullPointerException BotanErrorCode BotanErrorMessage CallStack
- data BadParameterException = BadParameterException BotanErrorCode BotanErrorMessage CallStack
- data KeyNotSetException = KeyNotSetException BotanErrorCode BotanErrorMessage CallStack
- data InvalidKeyLengthException = InvalidKeyLengthException BotanErrorCode BotanErrorMessage CallStack
- data InvalidObjectStateException = InvalidObjectStateException BotanErrorCode BotanErrorMessage CallStack
- data NotImplementedException = NotImplementedException BotanErrorCode BotanErrorMessage CallStack
- data InvalidObjectException = InvalidObjectException BotanErrorCode BotanErrorMessage CallStack
- data UnknownException = UnknownException BotanErrorCode BotanErrorMessage CallStack
Error codes
data BotanErrorCode Source #
Instances
| Show BotanErrorCode Source # | |
Defined in Botan.Low.Error.Internal Methods showsPrec :: Int -> BotanErrorCode -> ShowS # show :: BotanErrorCode -> String # showList :: [BotanErrorCode] -> ShowS # | |
| Eq BotanErrorCode Source # | |
Defined in Botan.Low.Error.Internal Methods (==) :: BotanErrorCode -> BotanErrorCode -> Bool # (/=) :: BotanErrorCode -> BotanErrorCode -> Bool # | |
botanErrorDescription :: BotanErrorCode -> IO ByteString Source #
Convert an error code into a string. Returns "Unknown error" if the error code is not a known one.
newtype BotanErrorMessage Source #
Constructors
| BotanErrorMessage ByteString |
Instances
| Show BotanErrorMessage Source # | |
Defined in Botan.Low.Error.Internal Methods showsPrec :: Int -> BotanErrorMessage -> ShowS # show :: BotanErrorMessage -> String # showList :: [BotanErrorMessage] -> ShowS # | |
botanErrorLastExceptionMessage :: IO BotanErrorMessage Source #
Returns a static string stored in a thread local variable which contains the last exception message thrown. WARNING: This string buffer is overwritten on the next call to the FFI layer
Exception hierarchy
data SomeBotanException Source #
The SomeBotanException type is the root of the botan exception type hierarchy.
Constructors
| forall e.Exception e => SomeBotanException e |
Instances
| Exception SomeBotanException Source # | |
Defined in Botan.Low.Error.Internal Methods toException :: SomeBotanException -> SomeException # fromException :: SomeException -> Maybe SomeBotanException # | |
| Show SomeBotanException Source # | |
Defined in Botan.Low.Error.Internal Methods showsPrec :: Int -> SomeBotanException -> ShowS # show :: SomeBotanException -> String # showList :: [SomeBotanException] -> ShowS # | |
toBotanException :: Exception e => e -> SomeException Source #
fromBotanException :: Exception e => SomeException -> Maybe e Source #
Individual exceptions
data InvalidInputException Source #
Instances
| Exception InvalidInputException Source # | |
Defined in Botan.Low.Error.Internal | |
| Show InvalidInputException Source # | |
Defined in Botan.Low.Error.Internal Methods showsPrec :: Int -> InvalidInputException -> ShowS # show :: InvalidInputException -> String # showList :: [InvalidInputException] -> ShowS # | |
data BadMACException Source #
Constructors
| BadMACException BotanErrorCode BotanErrorMessage CallStack |
Instances
| Exception BadMACException Source # | |
Defined in Botan.Low.Error.Internal Methods toException :: BadMACException -> SomeException # | |
| Show BadMACException Source # | |
Defined in Botan.Low.Error.Internal Methods showsPrec :: Int -> BadMACException -> ShowS # show :: BadMACException -> String # showList :: [BadMACException] -> ShowS # | |
data InsufficientBufferSpaceException Source #
Instances
data StringConversionException Source #
Instances
| Exception StringConversionException Source # | |
Defined in Botan.Low.Error.Internal | |
| Show StringConversionException Source # | |
Defined in Botan.Low.Error.Internal Methods showsPrec :: Int -> StringConversionException -> ShowS # show :: StringConversionException -> String # showList :: [StringConversionException] -> ShowS # | |
data ExceptionThrownException Source #
Instances
| Exception ExceptionThrownException Source # | |
Defined in Botan.Low.Error.Internal | |
| Show ExceptionThrownException Source # | |
Defined in Botan.Low.Error.Internal Methods showsPrec :: Int -> ExceptionThrownException -> ShowS # show :: ExceptionThrownException -> String # showList :: [ExceptionThrownException] -> ShowS # | |
data OutOfMemoryException Source #
Constructors
| OutOfMemoryException BotanErrorCode BotanErrorMessage CallStack |
Instances
| Exception OutOfMemoryException Source # | |
Defined in Botan.Low.Error.Internal Methods toException :: OutOfMemoryException -> SomeException # fromException :: SomeException -> Maybe OutOfMemoryException # | |
| Show OutOfMemoryException Source # | |
Defined in Botan.Low.Error.Internal Methods showsPrec :: Int -> OutOfMemoryException -> ShowS # show :: OutOfMemoryException -> String # showList :: [OutOfMemoryException] -> ShowS # | |
data SystemErrorException Source #
Constructors
| SystemErrorException BotanErrorCode BotanErrorMessage CallStack |
Instances
| Exception SystemErrorException Source # | |
Defined in Botan.Low.Error.Internal Methods toException :: SystemErrorException -> SomeException # fromException :: SomeException -> Maybe SystemErrorException # | |
| Show SystemErrorException Source # | |
Defined in Botan.Low.Error.Internal Methods showsPrec :: Int -> SystemErrorException -> ShowS # show :: SystemErrorException -> String # showList :: [SystemErrorException] -> ShowS # | |
data InternalErrorException Source #
Instances
| Exception InternalErrorException Source # | |
Defined in Botan.Low.Error.Internal | |
| Show InternalErrorException Source # | |
Defined in Botan.Low.Error.Internal Methods showsPrec :: Int -> InternalErrorException -> ShowS # show :: InternalErrorException -> String # showList :: [InternalErrorException] -> ShowS # | |
data BadFlagException Source #
Constructors
| BadFlagException BotanErrorCode BotanErrorMessage CallStack |
Instances
| Exception BadFlagException Source # | |
Defined in Botan.Low.Error.Internal Methods toException :: BadFlagException -> SomeException # | |
| Show BadFlagException Source # | |
Defined in Botan.Low.Error.Internal Methods showsPrec :: Int -> BadFlagException -> ShowS # show :: BadFlagException -> String # showList :: [BadFlagException] -> ShowS # | |
data NullPointerException Source #
Constructors
| NullPointerException BotanErrorCode BotanErrorMessage CallStack |
Instances
| Exception NullPointerException Source # | |
Defined in Botan.Low.Error.Internal Methods toException :: NullPointerException -> SomeException # fromException :: SomeException -> Maybe NullPointerException # | |
| Show NullPointerException Source # | |
Defined in Botan.Low.Error.Internal Methods showsPrec :: Int -> NullPointerException -> ShowS # show :: NullPointerException -> String # showList :: [NullPointerException] -> ShowS # | |
data BadParameterException Source #
Instances
| Exception BadParameterException Source # | |
Defined in Botan.Low.Error.Internal | |
| Show BadParameterException Source # | |
Defined in Botan.Low.Error.Internal Methods showsPrec :: Int -> BadParameterException -> ShowS # show :: BadParameterException -> String # showList :: [BadParameterException] -> ShowS # | |
data KeyNotSetException Source #
Constructors
| KeyNotSetException BotanErrorCode BotanErrorMessage CallStack |
Instances
| Exception KeyNotSetException Source # | |
Defined in Botan.Low.Error.Internal Methods toException :: KeyNotSetException -> SomeException # fromException :: SomeException -> Maybe KeyNotSetException # | |
| Show KeyNotSetException Source # | |
Defined in Botan.Low.Error.Internal Methods showsPrec :: Int -> KeyNotSetException -> ShowS # show :: KeyNotSetException -> String # showList :: [KeyNotSetException] -> ShowS # | |
data InvalidKeyLengthException Source #
Instances
| Exception InvalidKeyLengthException Source # | |
Defined in Botan.Low.Error.Internal | |
| Show InvalidKeyLengthException Source # | |
Defined in Botan.Low.Error.Internal Methods showsPrec :: Int -> InvalidKeyLengthException -> ShowS # show :: InvalidKeyLengthException -> String # showList :: [InvalidKeyLengthException] -> ShowS # | |
data InvalidObjectStateException Source #
Instances
| Exception InvalidObjectStateException Source # | |
Defined in Botan.Low.Error.Internal | |
| Show InvalidObjectStateException Source # | |
Defined in Botan.Low.Error.Internal Methods showsPrec :: Int -> InvalidObjectStateException -> ShowS # show :: InvalidObjectStateException -> String # showList :: [InvalidObjectStateException] -> ShowS # | |
data NotImplementedException Source #
Instances
| Exception NotImplementedException Source # | |
Defined in Botan.Low.Error.Internal | |
| Show NotImplementedException Source # | |
Defined in Botan.Low.Error.Internal Methods showsPrec :: Int -> NotImplementedException -> ShowS # show :: NotImplementedException -> String # showList :: [NotImplementedException] -> ShowS # | |
data InvalidObjectException Source #
Instances
| Exception InvalidObjectException Source # | |
Defined in Botan.Low.Error.Internal | |
| Show InvalidObjectException Source # | |
Defined in Botan.Low.Error.Internal Methods showsPrec :: Int -> InvalidObjectException -> ShowS # show :: InvalidObjectException -> String # showList :: [InvalidObjectException] -> ShowS # | |
data UnknownException Source #
Constructors
| UnknownException BotanErrorCode BotanErrorMessage CallStack |
Instances
| Exception UnknownException Source # | |
Defined in Botan.Low.Error.Internal Methods toException :: UnknownException -> SomeException # | |
| Show UnknownException Source # | |
Defined in Botan.Low.Error.Internal Methods showsPrec :: Int -> UnknownException -> ShowS # show :: UnknownException -> String # showList :: [UnknownException] -> ShowS # | |