diff options
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/llmessage/llhttpnode.cpp | 4 | ||||
| -rw-r--r-- | indra/newview/llsecapi.cpp | 2 | ||||
| -rw-r--r-- | indra/newview/llsecapi.h | 34 | ||||
| -rw-r--r-- | indra/viewer_components/updater/llupdateinstaller.cpp | 10 | 
4 files changed, 29 insertions, 21 deletions
| diff --git a/indra/llmessage/llhttpnode.cpp b/indra/llmessage/llhttpnode.cpp index f235965879..08688ca48b 100644 --- a/indra/llmessage/llhttpnode.cpp +++ b/indra/llmessage/llhttpnode.cpp @@ -31,6 +31,7 @@  #include "llstl.h"  #include "llhttpconstants.h" +#include <stdexcept>  const std::string CONTEXT_HEADERS("headers");  const std::string CONTEXT_PATH("path"); @@ -92,8 +93,9 @@ LLHTTPNode::~LLHTTPNode()  namespace { -	class NotImplemented +	struct NotImplemented: public std::runtime_error  	{ +		NotImplemented(): std::runtime_error("LLHTTPNode::NotImplemented") {}  	};  } diff --git a/indra/newview/llsecapi.cpp b/indra/newview/llsecapi.cpp index 4f9f83b6f2..c27709a57b 100644 --- a/indra/newview/llsecapi.cpp +++ b/indra/newview/llsecapi.cpp @@ -69,7 +69,7 @@ void initializeSecHandler()  	}  	if (!exception_msg.empty())  // an exception was thrown.  	{ -		throw LLProtectedDataException(exception_msg.c_str()); +		throw LLProtectedDataException(exception_msg);  	}  } diff --git a/indra/newview/llsecapi.h b/indra/newview/llsecapi.h index 6fe3ee31cf..02438f77b7 100644 --- a/indra/newview/llsecapi.h +++ b/indra/newview/llsecapi.h @@ -32,6 +32,7 @@  #include <openssl/x509.h>  #include <ostream>  #include "llpointer.h" +#include <stdexcept>  #ifdef LL_WINDOWS  #pragma warning(disable:4250) @@ -116,17 +117,14 @@ -class LLProtectedDataException +struct LLProtectedDataException: public std::runtime_error  { -public: -	LLProtectedDataException(const char *msg)  +	LLProtectedDataException(const std::string& msg): +		std::runtime_error(msg)  	{ -		LL_WARNS("SECAPI") << "Protected Data Error: " << (std::string)msg << LL_ENDL; -		mMsg = (std::string)msg; +		LL_WARNS("SECAPI") << "Protected Data Error: " << msg << LL_ENDL;  	} -	std::string getMessage() { return mMsg; } -protected: -	std::string mMsg; +	std::string getMessage() { return what(); }  };  // class LLCertificate @@ -334,22 +332,22 @@ std::ostream& operator <<(std::ostream& s, const LLCredential& cred);  // All error handling is via exceptions. -class LLCertException +class LLCertException: public std::runtime_error  {  public: -	LLCertException(LLPointer<LLCertificate> cert, const char* msg) +	LLCertException(LLPointer<LLCertificate> cert, const std::string& msg): +		std::runtime_error(msg)  	{  		mCert = cert; -		LL_WARNS("SECAPI") << "Certificate Error: " << (std::string)msg << LL_ENDL; -		mMsg = (std::string)msg; +		LL_WARNS("SECAPI") << "Certificate Error: " << msg << LL_ENDL;  	} +	virtual ~LLCertException() throw() {}  	LLPointer<LLCertificate> getCert() { return mCert; } -	std::string getMessage() { return mMsg; } +	std::string getMessage() { return what(); }  protected:  	LLPointer<LLCertificate> mCert; -	std::string mMsg;  };  class LLInvalidCertificate : public LLCertException @@ -358,6 +356,7 @@ public:  	LLInvalidCertificate(LLPointer<LLCertificate> cert) : LLCertException(cert, "CertInvalid")  	{  	} +	virtual ~LLInvalidCertificate() throw() {}  protected:  }; @@ -367,6 +366,7 @@ public:  	LLCertValidationTrustException(LLPointer<LLCertificate> cert) : LLCertException(cert, "CertUntrusted")  	{  	} +	virtual ~LLCertValidationTrustException() throw() {}  protected:  }; @@ -378,7 +378,7 @@ public:  	{  		mHostname = hostname;  	} -	 +	virtual ~LLCertValidationHostnameException() throw() {}  	std::string getHostname() { return mHostname; }  protected:  	std::string mHostname; @@ -392,6 +392,7 @@ public:  	{  		mTime = current_time;  	} +	virtual ~LLCertValidationExpirationException() throw() {}  	LLDate GetTime() { return mTime; }  protected:  	LLDate mTime; @@ -403,6 +404,7 @@ public:  	LLCertKeyUsageValidationException(LLPointer<LLCertificate> cert) : LLCertException(cert, "CertKeyUsage")  	{  	} +	virtual ~LLCertKeyUsageValidationException() throw() {}  protected:  }; @@ -412,6 +414,7 @@ public:  	LLCertBasicConstraintsValidationException(LLPointer<LLCertificate> cert) : LLCertException(cert, "CertBasicConstraints")  	{  	} +	virtual ~LLCertBasicConstraintsValidationException() throw() {}  protected:  }; @@ -421,6 +424,7 @@ public:  	LLCertValidationInvalidSignatureException(LLPointer<LLCertificate> cert) : LLCertException(cert, "CertInvalidSignature")  	{  	} +	virtual ~LLCertValidationInvalidSignatureException() throw() {}  protected:  }; diff --git a/indra/viewer_components/updater/llupdateinstaller.cpp b/indra/viewer_components/updater/llupdateinstaller.cpp index a0e2c0b362..4432c6574e 100644 --- a/indra/viewer_components/updater/llupdateinstaller.cpp +++ b/indra/viewer_components/updater/llupdateinstaller.cpp @@ -35,12 +35,14 @@  #pragma warning(disable: 4702)      // disable 'unreachable code' so we can use lexical_cast (really!).  #endif  #include <boost/lexical_cast.hpp> - +#include <stdexcept>  namespace { -	class RelocateError {}; -	 -	 +	struct RelocateError: public std::runtime_error +	{ +		RelocateError(): std::runtime_error("llupdateinstaller: RelocateError") {} +	}; +  	std::string copy_to_temp(std::string const & path)  	{  		std::string scriptFile = gDirUtilp->getBaseFileName(path); | 
