diff options
| author | Nat Goodspeed <nat@lindenlab.com> | 2016-08-17 11:41:12 -0400 |
|---|---|---|
| committer | Nat Goodspeed <nat@lindenlab.com> | 2016-08-17 11:41:12 -0400 |
| commit | e72bdc9bc5895267f77bf3eac8d68f82f5e2806b (patch) | |
| tree | bb86f9ae3e199a994ec5e2255d9af0de3fa17c95 /indra/llcommon/llexception.cpp | |
| parent | 4fb100ac7a33174883184f1320d0beac08ead3a7 (diff) | |
| parent | 5e9d2f57c82a57307a48afea09aa539b9fa80abf (diff) | |
Automated merge with ssh://bitbucket.org/lindenlab/viewer-release
Diffstat (limited to 'indra/llcommon/llexception.cpp')
| -rw-r--r-- | indra/llcommon/llexception.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/indra/llcommon/llexception.cpp b/indra/llcommon/llexception.cpp new file mode 100644 index 0000000000..f48509b2aa --- /dev/null +++ b/indra/llcommon/llexception.cpp @@ -0,0 +1,41 @@ +/** + * @file llexception.cpp + * @author Nat Goodspeed + * @date 2016-08-12 + * @brief Implementation for llexception. + * + * $LicenseInfo:firstyear=2016&license=viewerlgpl$ + * Copyright (c) 2016, Linden Research, Inc. + * $/LicenseInfo$ + */ + +// Precompiled header +#include "linden_common.h" +// associated header +#include "llexception.h" +// STL headers +// std headers +#include <typeinfo> +// external library headers +#include <boost/exception/diagnostic_information.hpp> +// other Linden headers +#include "llerror.h" + +void crash_on_unhandled_exception_(const char* file, int line, const char* pretty_function) +{ + // LL_ERRS() terminates, but also propagates message into crash dump. + LL_ERRS() << file << "(" << line << "): Unhandled exception caught in " << pretty_function + << ":\n" << boost::current_exception_diagnostic_information() << LL_ENDL; +} + +void log_unhandled_exception_(const char* file, int line, const char* pretty_function, + const LLContinueError& e) +{ + // Use LL_WARNS() because we seriously do not expect this to happen + // routinely, but we DO expect to return from this function. Deriving your + // exception from LLContinueError implies that such an exception should + // NOT be fatal to the viewer, only to its current task. + LL_WARNS() << file << "(" << line << "): Unhandled " << typeid(e).name() + << " exception caught in " << pretty_function + << ":\n" << boost::current_exception_diagnostic_information() << LL_ENDL; +} |
