Skip to content
Snippets Groups Projects
Commit 913cb543 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

crypto: improve exception types

parent b380c9ff
Branches
Tags
No related merge requests found
......@@ -44,7 +44,10 @@ namespace crypto {
class OPENDHT_PUBLIC CryptoException : public std::runtime_error {
public:
CryptoException(const std::string& str) : std::runtime_error(str) {};
explicit CryptoException(const std::string& str) : std::runtime_error(str) {};
explicit CryptoException(const char* str) : std::runtime_error(str) {};
CryptoException(const CryptoException& e) noexcept = default;
CryptoException& operator=(const CryptoException&) noexcept = default;
};
/**
......@@ -52,7 +55,10 @@ class OPENDHT_PUBLIC CryptoException : public std::runtime_error {
*/
class OPENDHT_PUBLIC DecryptError : public CryptoException {
public:
DecryptError(const std::string& str = "") : CryptoException(str) {};
explicit DecryptError(const std::string& str) : CryptoException(str) {};
explicit DecryptError(const char* str) : CryptoException(str) {};
DecryptError(const DecryptError& e) noexcept = default;
DecryptError& operator=(const DecryptError&) noexcept = default;
};
struct PrivateKey;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment