diff options
author | Jack Lloyd <[email protected]> | 2019-05-24 03:45:29 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2019-05-24 03:45:29 -0400 |
commit | f5c0d868f685c5e67c164b03cb8129985fd56bee (patch) | |
tree | e156f40e3566493e9469cc56b41e794a66e8daca /src/lib/utils/exceptn.cpp | |
parent | daa0e6f5af59135f0049ebdd7b666b13bd6b3224 (diff) | |
parent | 9e5ddd2358d07859da54365bca04bd71a938e68e (diff) |
Merge GH #1971 Add error_type for database error
Diffstat (limited to 'src/lib/utils/exceptn.cpp')
-rw-r--r-- | src/lib/utils/exceptn.cpp | 110 |
1 files changed, 56 insertions, 54 deletions
diff --git a/src/lib/utils/exceptn.cpp b/src/lib/utils/exceptn.cpp index 3876c3b26..d5845e09d 100644 --- a/src/lib/utils/exceptn.cpp +++ b/src/lib/utils/exceptn.cpp @@ -9,62 +9,64 @@ namespace Botan { std::string to_string(ErrorType type) -{ - switch(type) { - case ErrorType::Unknown: - return "Unknown"; - case ErrorType::SystemError: - return "SystemError"; - case ErrorType::NotImplemented: - return "NotImplemented"; - case ErrorType::OutOfMemory: - return "OutOfMemory"; - case ErrorType::InternalError: - return "InternalError"; - case ErrorType::IoError: - return "IoError"; - case ErrorType::InvalidObjectState : - return "InvalidObjectState"; - case ErrorType::KeyNotSet: - return "KeyNotSet"; - case ErrorType::InvalidArgument: - return "InvalidArgument"; - case ErrorType::InvalidKeyLength: - return "InvalidKeyLength"; - case ErrorType::InvalidNonceLength: - return "InvalidNonceLength"; - case ErrorType::LookupError: - return "LookupError"; - case ErrorType::EncodingFailure: - return "EncodingFailure"; - case ErrorType::DecodingFailure: - return "DecodingFailure"; - case ErrorType::TLSError: - return "TLSError"; - case ErrorType::HttpError: - return "HttpError"; - case ErrorType::InvalidTag: - return "InvalidTag"; - case ErrorType::OpenSSLError : - return "OpenSSLError"; - case ErrorType::CommonCryptoError: - return "CommonCryptoError"; - case ErrorType::Pkcs11Error: - return "Pkcs11Error"; - case ErrorType::TPMError: - return "TPMError"; - case ErrorType::ZlibError : - return "ZlibError"; - case ErrorType::Bzip2Error: - return "Bzip2Error" ; - case ErrorType::LzmaError: - return "LzmaError"; - - default: - return "unrecognized botan error"; + switch(type) + { + case ErrorType::Unknown: + return "Unknown"; + case ErrorType::SystemError: + return "SystemError"; + case ErrorType::NotImplemented: + return "NotImplemented"; + case ErrorType::OutOfMemory: + return "OutOfMemory"; + case ErrorType::InternalError: + return "InternalError"; + case ErrorType::IoError: + return "IoError"; + case ErrorType::InvalidObjectState : + return "InvalidObjectState"; + case ErrorType::KeyNotSet: + return "KeyNotSet"; + case ErrorType::InvalidArgument: + return "InvalidArgument"; + case ErrorType::InvalidKeyLength: + return "InvalidKeyLength"; + case ErrorType::InvalidNonceLength: + return "InvalidNonceLength"; + case ErrorType::LookupError: + return "LookupError"; + case ErrorType::EncodingFailure: + return "EncodingFailure"; + case ErrorType::DecodingFailure: + return "DecodingFailure"; + case ErrorType::TLSError: + return "TLSError"; + case ErrorType::HttpError: + return "HttpError"; + case ErrorType::InvalidTag: + return "InvalidTag"; + case ErrorType::OpenSSLError : + return "OpenSSLError"; + case ErrorType::CommonCryptoError: + return "CommonCryptoError"; + case ErrorType::Pkcs11Error: + return "Pkcs11Error"; + case ErrorType::TPMError: + return "TPMError"; + case ErrorType::DatabaseError: + return "DatabaseError"; + case ErrorType::ZlibError : + return "ZlibError"; + case ErrorType::Bzip2Error: + return "Bzip2Error" ; + case ErrorType::LzmaError: + return "LzmaError"; + } + + // No default case in above switch so compiler warns + return "Unrecognized Botan error"; } -} Exception::Exception(const std::string& msg) : m_msg(msg) {} |