summaryrefslogtreecommitdiff
path: root/indra/llcommon/llexception.h
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2016-08-17 11:36:24 -0400
committerNat Goodspeed <nat@lindenlab.com>2016-08-17 11:36:24 -0400
commit5e9d2f57c82a57307a48afea09aa539b9fa80abf (patch)
treeea16b2c580c2a831f54c217deb5d64b8d755eff4 /indra/llcommon/llexception.h
parent1ed76c382e8b87bff02b6d37cf8acd7f6b1f8063 (diff)
MAINT-5011: Use LLTHROW() instead of plain BOOST_THROW_EXCEPTION().
A level of preprocessor indirection lets us later change the implementation if desired.
Diffstat (limited to 'indra/llcommon/llexception.h')
-rw-r--r--indra/llcommon/llexception.h16
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__)