diff options
Diffstat (limited to 'src/lib/prov/openssl/openssl.h')
-rw-r--r-- | src/lib/prov/openssl/openssl.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/lib/prov/openssl/openssl.h b/src/lib/prov/openssl/openssl.h index 3db7b39af..a68dda5af 100644 --- a/src/lib/prov/openssl/openssl.h +++ b/src/lib/prov/openssl/openssl.h @@ -33,11 +33,16 @@ enum Cipher_Dir : int; class BOTAN_PUBLIC_API(2,0) OpenSSL_Error final : public Exception { public: - OpenSSL_Error(const std::string& what) : - Exception(what + " failed: " + ERR_error_string(ERR_get_error(), nullptr)) {} - OpenSSL_Error(const std::string& what, int err) : - Exception(what + " failed: " + ERR_error_string(err, nullptr)) {} + Exception(what + " failed: " + ERR_error_string(err, nullptr)), + m_err(err) {} + + ErrorType error_type() const noexcept override { return ErrorType::OpenSSLError; } + + int error_code() const noexcept override { return m_err; } + + private: + int m_err; }; /* Block Ciphers */ |