summaryrefslogtreecommitdiff
path: root/indra/newview/llsechandler_basic.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2016-08-17 15:40:03 -0400
committerNat Goodspeed <nat@lindenlab.com>2016-08-17 15:40:03 -0400
commit993f54f6e91d78a9c2e1389ad878d6bd46e9be5b (patch)
tree138fb7e1213ab0100b4662d30c4f60921e920f37 /indra/newview/llsechandler_basic.cpp
parentdb4f13e7bcfc7ef61f750152494f1e52ad5a9080 (diff)
MAINT-5011: Try to enrich catch (...) logging throughout viewer.
Turns out we have a surprising number of catch (...) clauses in the viewer code base. If all we currently do is LL_ERRS() << "unknown exception" << LL_ENDL; then call CRASH_ON_UNHANDLED_EXCEPTION() instead. If what we do is LL_WARNS() << "unknown exception" << LL_ENDL; then call LOG_UNHANDLED_EXCEPTION() instead. Since many places need LOG_UNHANDLED_EXCEPTION() and nobody catches LLContinueError yet, eliminate LLContinueError& parameter from LOG_UNHANDLED_EXCEPTION(). This permits us to use the same log message as CRASH_ON_UNHANDLED_EXCEPTION(), just with a different severity level. Where a catch (...) clause actually provides contextual information, or makes an error string, add boost::current_exception_diagnostic_information() to try to figure out actual exception class and message.
Diffstat (limited to 'indra/newview/llsechandler_basic.cpp')
-rw-r--r--indra/newview/llsechandler_basic.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/indra/newview/llsechandler_basic.cpp b/indra/newview/llsechandler_basic.cpp
index 183a625382..54396cb9a4 100644
--- a/indra/newview/llsechandler_basic.cpp
+++ b/indra/newview/llsechandler_basic.cpp
@@ -38,6 +38,7 @@
#include "llexception.h"
#include <vector>
#include <ios>
+#include <boost/exception/diagnostic_information.hpp>
#include <openssl/ossl_typ.h>
#include <openssl/x509.h>
#include <openssl/x509v3.h>
@@ -618,7 +619,8 @@ void LLBasicCertificateStore::load_from_file(const std::string& filename)
}
catch (...)
{
- LL_WARNS("SECAPI") << "Failure creating certificate from the certificate store file." << LL_ENDL;
+ LL_WARNS("SECAPI") << "Failure creating certificate from the certificate store file: "
+ << boost::current_exception_diagnostic_information() << LL_ENDL;
}
X509_free(cert_x509);
cert_x509 = NULL;
@@ -1365,7 +1367,8 @@ void LLSecAPIBasicHandler::_writeProtectedData()
}
catch (...)
{
- LL_WARNS() << "LLProtectedDataException(Error writing Protected Data Store)" << LL_ENDL;
+ LL_WARNS() << "LLProtectedDataException(Error writing Protected Data Store): "
+ << boost::current_exception_diagnostic_information() << LL_ENDL;
// it's good practice to clean up any secure information on error
// (even though this file isn't really secure. Perhaps in the future
// it may be, however.
@@ -1394,7 +1397,8 @@ void LLSecAPIBasicHandler::_writeProtectedData()
catch (...)
{
LL_WARNS() << "LLProtectedDataException(Error renaming '" << tmp_filename
- << "' to '" << mProtectedDataFilename << "')" << LL_ENDL;
+ << "' to '" << mProtectedDataFilename << "'): "
+ << boost::current_exception_diagnostic_information() << LL_ENDL;
// it's good practice to clean up any secure information on error
// (even though this file isn't really secure. Perhaps in the future
// it may be, however.