7#include <botan/exceptn.h>
9#include <botan/internal/fmt.h>
20 return "NotImplemented";
24 return "InternalError";
28 return "InvalidObjectState";
32 return "InvalidArgument";
34 return "InvalidKeyLength";
36 return "InvalidNonceLength";
40 return "EncodingFailure";
42 return "DecodingFailure";
50 return "RoughtimeError";
52 return "CommonCryptoError";
58 return "DatabaseError";
68 return "Unrecognized Botan error";
86std::string format_lookup_error(std::string_view type, std::string_view algo, std::string_view provider) {
87 if(provider.empty()) {
88 return fmt(
"Unavailable {} {}", type, algo);
90 return fmt(
"Unavailable {} {} for provider {}", type, algo, provider);
97 Exception(format_lookup_error(type, algo, provider)) {}
118 Lookup_Error(
fmt(
"Could not find provider '{}' for algorithm '{}'", provider, algo)) {}
133 Exception(
"Invalid authentication tag:", msg) {}
138 Exception(
fmt(
"{} error code {}", msg, err_code)), m_error_code(err_code) {}
Algorithm_Not_Found(std::string_view name)
Decoding_Error(std::string_view name)
Encoding_Error(std::string_view name)
Exception(std::string_view msg)
Internal_Error(std::string_view err)
Invalid_Algorithm_Name(std::string_view name)
Invalid_Argument(std::string_view msg)
Invalid_Authentication_Tag(std::string_view msg)
Invalid_IV_Length(std::string_view mode, size_t bad_len)
Invalid_Key_Length(std::string_view name, size_t length)
Key_Not_Set(std::string_view algo)
Lookup_Error(std::string_view err)
Not_Implemented(std::string_view err)
PRNG_Unseeded(std::string_view algo)
Provider_Not_Found(std::string_view algo, std::string_view provider)
Stream_IO_Error(std::string_view err)
System_Error(std::string_view msg)
Unknown_PK_Field_Name(std::string_view algo_name, std::string_view field_name)
std::string fmt(std::string_view format, const T &... args)
std::string to_string(ErrorType type)
Convert an ErrorType to string.