botan-low
Copyright(c) 2023-2024 Apotheca Labs
(c) 2024-2025 Haskell Foundation
LicenseBSD-3-Clause
Maintainerjoris@well-typed.com, leo@apotheca.io
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageGHC2021

Botan.Low.Error

Description

This module is based on the Return codes section of the C Botan FFI documentation.

Synopsis

Error codes

data BotanErrorCode Source #

Instances

Instances details
Show BotanErrorCode Source # 
Instance details

Defined in Botan.Low.Error.Internal

Methods

showsPrec :: Int -> BotanErrorCode -> ShowS

show :: BotanErrorCode -> String

showList :: [BotanErrorCode] -> ShowS

Eq BotanErrorCode Source # 
Instance details

Defined in Botan.Low.Error.Internal

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

Instances details
Show BotanErrorMessage Source # 
Instance details

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

Exception e => SomeBotanException e 

Instances

Instances details
Exception SomeBotanException Source # 
Instance details

Defined in Botan.Low.Error.Internal

Show SomeBotanException Source # 
Instance details

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

Instances details
Exception InvalidInputException Source # 
Instance details

Defined in Botan.Low.Error.Internal

Show InvalidInputException Source # 
Instance details

Defined in Botan.Low.Error.Internal

Methods

showsPrec :: Int -> InvalidInputException -> ShowS

show :: InvalidInputException -> String

showList :: [InvalidInputException] -> ShowS

data BadMACException Source #

Instances

Instances details
Exception BadMACException Source # 
Instance details

Defined in Botan.Low.Error.Internal

Methods

toException :: BadMACException -> SomeException

fromException :: SomeException -> Maybe BadMACException

displayException :: BadMACException -> String

backtraceDesired :: BadMACException -> Bool

Show BadMACException Source # 
Instance details

Defined in Botan.Low.Error.Internal

Methods

showsPrec :: Int -> BadMACException -> ShowS

show :: BadMACException -> String

showList :: [BadMACException] -> ShowS

data OutOfMemoryException Source #

Instances

Instances details
Exception OutOfMemoryException Source # 
Instance details

Defined in Botan.Low.Error.Internal

Show OutOfMemoryException Source # 
Instance details

Defined in Botan.Low.Error.Internal

Methods

showsPrec :: Int -> OutOfMemoryException -> ShowS

show :: OutOfMemoryException -> String

showList :: [OutOfMemoryException] -> ShowS

data SystemErrorException Source #

Instances

Instances details
Exception SystemErrorException Source # 
Instance details

Defined in Botan.Low.Error.Internal

Show SystemErrorException Source # 
Instance details

Defined in Botan.Low.Error.Internal

Methods

showsPrec :: Int -> SystemErrorException -> ShowS

show :: SystemErrorException -> String

showList :: [SystemErrorException] -> ShowS

data BadFlagException Source #

Instances

Instances details
Exception BadFlagException Source # 
Instance details

Defined in Botan.Low.Error.Internal

Methods

toException :: BadFlagException -> SomeException

fromException :: SomeException -> Maybe BadFlagException

displayException :: BadFlagException -> String

backtraceDesired :: BadFlagException -> Bool

Show BadFlagException Source # 
Instance details

Defined in Botan.Low.Error.Internal

Methods

showsPrec :: Int -> BadFlagException -> ShowS

show :: BadFlagException -> String

showList :: [BadFlagException] -> ShowS

data NullPointerException Source #

Instances

Instances details
Exception NullPointerException Source # 
Instance details

Defined in Botan.Low.Error.Internal

Show NullPointerException Source # 
Instance details

Defined in Botan.Low.Error.Internal

Methods

showsPrec :: Int -> NullPointerException -> ShowS

show :: NullPointerException -> String

showList :: [NullPointerException] -> ShowS

data BadParameterException Source #

Instances

Instances details
Exception BadParameterException Source # 
Instance details

Defined in Botan.Low.Error.Internal

Show BadParameterException Source # 
Instance details

Defined in Botan.Low.Error.Internal

Methods

showsPrec :: Int -> BadParameterException -> ShowS

show :: BadParameterException -> String

showList :: [BadParameterException] -> ShowS

data KeyNotSetException Source #

Instances

Instances details
Exception KeyNotSetException Source # 
Instance details

Defined in Botan.Low.Error.Internal

Show KeyNotSetException Source # 
Instance details

Defined in Botan.Low.Error.Internal

Methods

showsPrec :: Int -> KeyNotSetException -> ShowS

show :: KeyNotSetException -> String

showList :: [KeyNotSetException] -> ShowS

data UnknownException Source #

Instances

Instances details
Exception UnknownException Source # 
Instance details

Defined in Botan.Low.Error.Internal

Methods

toException :: UnknownException -> SomeException

fromException :: SomeException -> Maybe UnknownException

displayException :: UnknownException -> String

backtraceDesired :: UnknownException -> Bool

Show UnknownException Source # 
Instance details

Defined in Botan.Low.Error.Internal

Methods

showsPrec :: Int -> UnknownException -> ShowS

show :: UnknownException -> String

showList :: [UnknownException] -> ShowS