diff options
Diffstat (limited to 'indra/llcommon/llexception.h')
-rw-r--r-- | indra/llcommon/llexception.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/indra/llcommon/llexception.h b/indra/llcommon/llexception.h index 68bd20fbcd..e9e25ae689 100644 --- a/indra/llcommon/llexception.h +++ b/indra/llcommon/llexception.h @@ -14,6 +14,7 @@ #include <stdexcept> #include <boost/exception/exception.hpp> +#include <boost/throw_exception.hpp> // "Found someone who can comfort me // But there are always exceptions..." @@ -30,12 +31,6 @@ * all we need to do with an exception is log it, in most places we should * catch (...) and log boost::current_exception_diagnostic_information(). * - * Please use BOOST_THROW_EXCEPTION() - * http://www.boost.org/doc/libs/release/libs/exception/doc/BOOST_THROW_EXCEPTION.html - * to throw viewer exceptions whenever possible. This enriches the exception's - * diagnostic_information() with the source file, line and containing function - * of the BOOST_THROW_EXCEPTION() macro. - * * There may be circumstances in which it would be valuable to distinguish an * exception explicitly thrown by viewer code from an exception thrown by * (say) a third-party library. Catching (const LLException&) supports such @@ -65,6 +60,15 @@ struct LLContinueError: public LLException {} }; +/** + * Please use LLTHROW() to throw viewer exceptions whenever possible. This + * enriches the exception's diagnostic_information() with the source file, + * line and containing function of the LLTHROW() macro. + */ +// Currently we implement that using BOOST_THROW_EXCEPTION(). Wrap it in +// LLTHROW() in case we ever want to revisit that implementation decision. +#define LLTHROW(x) BOOST_THROW_EXCEPTION(x) + /// Call this macro from a catch (...) clause #define CRASH_ON_UNHANDLED_EXCEPTION() \ crash_on_unhandled_exception_(__FILE__, __LINE__, __PRETTY_FUNCTION__) |