summaryrefslogtreecommitdiff
path: root/indra/newview
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
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')
-rw-r--r--indra/newview/llaccountingcostmanager.cpp3
-rw-r--r--indra/newview/llappcorehttp.cpp2
-rw-r--r--indra/newview/llsecapi.cpp1
-rw-r--r--indra/newview/llsechandler_basic.cpp10
4 files changed, 12 insertions, 4 deletions
diff --git a/indra/newview/llaccountingcostmanager.cpp b/indra/newview/llaccountingcostmanager.cpp
index 92a5413adb..a4a54cf8fb 100644
--- a/indra/newview/llaccountingcostmanager.cpp
+++ b/indra/newview/llaccountingcostmanager.cpp
@@ -31,6 +31,7 @@
#include "llcoros.h"
#include "lleventcoro.h"
#include "llcorehttputil.h"
+#include "llexception.h"
#include <algorithm>
#include <iterator>
@@ -160,7 +161,7 @@ void LLAccountingCostManager::accountingCostCoro(std::string url,
}
catch (...)
{
- LL_WARNS() << "Caught unknown exception." << LL_ENDL;
+ LOG_UNHANDLED_EXCEPTION();
}
mPendingObjectQuota.clear();
diff --git a/indra/newview/llappcorehttp.cpp b/indra/newview/llappcorehttp.cpp
index dbcae57de7..7ec041c02e 100644
--- a/indra/newview/llappcorehttp.cpp
+++ b/indra/newview/llappcorehttp.cpp
@@ -30,6 +30,7 @@
#include "llappviewer.h"
#include "llviewercontrol.h"
+#include "llexception.h"
#include <openssl/x509_vfy.h>
#include <openssl/ssl.h>
@@ -551,6 +552,7 @@ LLCore::HttpStatus LLAppCoreHttp::sslVerify(const std::string &url,
}
catch (...)
{
+ LOG_UNHANDLED_EXCEPTION();
// any other odd error, we just handle as a connect error.
result = LLCore::HttpStatus(LLCore::HttpStatus::EXT_CURL_EASY, CURLE_SSL_CONNECT_ERROR);
}
diff --git a/indra/newview/llsecapi.cpp b/indra/newview/llsecapi.cpp
index 933f7bb16e..6ca1e63417 100644
--- a/indra/newview/llsecapi.cpp
+++ b/indra/newview/llsecapi.cpp
@@ -121,6 +121,7 @@ LLSD LLCredential::getLoginParams()
}
catch (...)
{
+ LOG_UNHANDLED_EXCEPTION();
// we could have corrupt data, so simply return a null login param if so
LL_WARNS("AppInit") << "Invalid credential" << LL_ENDL;
}
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.