Skip to content
Snippets Groups Projects
Commit 47d93e4f authored by Nat Goodspeed's avatar Nat Goodspeed
Browse files

DRTVWR-418: Remove rogue getMessage() from llsecapi.h exceptions.

The LLProtectedDataException and LLCertException exception classes didn't used
to be derived from std::exception, so they followed their own getMessage()
convention instead of the standard what() convention. Now that they're derived
from std::exception, remove getMessage() and change its few consumers to use
what() instead. Thanks NickyD for suggesting.
parent cefa598e
No related branches found
No related tags found
No related merge requests found
...@@ -534,7 +534,7 @@ LLCore::HttpStatus LLAppCoreHttp::sslVerify(const std::string &url, ...@@ -534,7 +534,7 @@ LLCore::HttpStatus LLAppCoreHttp::sslVerify(const std::string &url,
// somewhat clumsy, as we may run into errors that do not map directly to curl // somewhat clumsy, as we may run into errors that do not map directly to curl
// error codes. Should be refactored with login refactoring, perhaps. // error codes. Should be refactored with login refactoring, perhaps.
result = LLCore::HttpStatus(LLCore::HttpStatus::EXT_CURL_EASY, CURLE_SSL_CACERT); result = LLCore::HttpStatus(LLCore::HttpStatus::EXT_CURL_EASY, CURLE_SSL_CACERT);
result.setMessage(cert_exception.getMessage()); result.setMessage(cert_exception.what());
LLPointer<LLCertificate> cert = cert_exception.getCert(); LLPointer<LLCertificate> cert = cert_exception.getCert();
cert->ref(); // adding an extra ref here cert->ref(); // adding an extra ref here
result.setErrorData(cert.get()); result.setErrorData(cert.get());
...@@ -544,7 +544,7 @@ LLCore::HttpStatus LLAppCoreHttp::sslVerify(const std::string &url, ...@@ -544,7 +544,7 @@ LLCore::HttpStatus LLAppCoreHttp::sslVerify(const std::string &url,
catch (LLCertException &cert_exception) catch (LLCertException &cert_exception)
{ {
result = LLCore::HttpStatus(LLCore::HttpStatus::EXT_CURL_EASY, CURLE_SSL_PEER_CERTIFICATE); result = LLCore::HttpStatus(LLCore::HttpStatus::EXT_CURL_EASY, CURLE_SSL_PEER_CERTIFICATE);
result.setMessage(cert_exception.getMessage()); result.setMessage(cert_exception.what());
LLPointer<LLCertificate> cert = cert_exception.getCert(); LLPointer<LLCertificate> cert = cert_exception.getCert();
cert->ref(); // adding an extra ref here cert->ref(); // adding an extra ref here
result.setErrorData(cert.get()); result.setErrorData(cert.get());
......
...@@ -64,7 +64,7 @@ void initializeSecHandler() ...@@ -64,7 +64,7 @@ void initializeSecHandler()
} }
catch (LLProtectedDataException e) catch (LLProtectedDataException e)
{ {
exception_msg = e.getMessage(); exception_msg = e.what();
} }
} }
if (!exception_msg.empty()) // an exception was thrown. if (!exception_msg.empty()) // an exception was thrown.
......
...@@ -124,7 +124,6 @@ struct LLProtectedDataException: public std::runtime_error ...@@ -124,7 +124,6 @@ struct LLProtectedDataException: public std::runtime_error
{ {
LL_WARNS("SECAPI") << "Protected Data Error: " << msg << LL_ENDL; LL_WARNS("SECAPI") << "Protected Data Error: " << msg << LL_ENDL;
} }
std::string getMessage() const { return what(); }
}; };
// class LLCertificate // class LLCertificate
...@@ -345,7 +344,6 @@ class LLCertException: public std::runtime_error ...@@ -345,7 +344,6 @@ class LLCertException: public std::runtime_error
} }
virtual ~LLCertException() throw() {} virtual ~LLCertException() throw() {}
LLPointer<LLCertificate> getCert() const { return mCert; } LLPointer<LLCertificate> getCert() const { return mCert; }
std::string getMessage() const { return what(); }
protected: protected:
LLPointer<LLCertificate> mCert; LLPointer<LLCertificate> mCert;
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment