summaryrefslogtreecommitdiff
path: root/indra/llcommon/llevents.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcommon/llevents.h')
-rw-r--r--indra/llcommon/llevents.h46
1 files changed, 33 insertions, 13 deletions
diff --git a/indra/llcommon/llevents.h b/indra/llcommon/llevents.h
index 6c8b66f596..02f1fa111b 100644
--- a/indra/llcommon/llevents.h
+++ b/indra/llcommon/llevents.h
@@ -37,7 +37,6 @@
#include <set>
#include <vector>
#include <deque>
-#include <stdexcept>
#if LL_WINDOWS
#pragma warning (push)
#pragma warning (disable : 4263) // boost::signals2::expired_slot::what() has const mismatch
@@ -62,6 +61,7 @@
#include "llsingleton.h"
#include "lldependencies.h"
#include "llstl.h"
+#include "llexception.h"
/*==========================================================================*|
// override this to allow binding free functions with more parameters
@@ -95,12 +95,32 @@ struct LLStopWhenHandled
result_type operator()(InputIterator first, InputIterator last) const
{
for (InputIterator si = first; si != last; ++si)
- {
- if (*si)
- {
- return true;
- }
- }
+ {
+ try
+ {
+ if (*si)
+ {
+ return true;
+ }
+ }
+ catch (const LLContinueError&)
+ {
+ // We catch LLContinueError here because an LLContinueError-
+ // based exception means the viewer as a whole should carry on
+ // to the best of our ability. Therefore subsequent listeners
+ // on the same LLEventPump should still receive this event.
+
+ // The iterator passed to a boost::signals2 Combiner is very
+ // clever, but provides no contextual information. We would
+ // very much like to be able to log the name of the LLEventPump
+ // plus the name of this particular listener, but alas.
+ LOG_UNHANDLED_EXCEPTION("LLEventPump");
+ }
+ // We do NOT catch (...) here because we might as well let it
+ // propagate out to the generic handler. If we were able to log
+ // context information here, that would be great, but we can't, so
+ // there's no point.
+ }
return false;
}
};
@@ -188,10 +208,10 @@ public:
bool operator()(const LLSD& event) const;
/// exception if you try to call when empty
- struct Empty: public std::runtime_error
+ struct Empty: public LLException
{
Empty(const std::string& what):
- std::runtime_error(std::string("LLListenerOrPumpName::Empty: ") + what) {}
+ LLException(std::string("LLListenerOrPumpName::Empty: ") + what) {}
};
private:
@@ -370,10 +390,10 @@ public:
* you didn't pass <tt>tweak=true</tt> to permit it to generate a unique
* variant.
*/
- struct DupPumpName: public std::runtime_error
+ struct DupPumpName: public LLException
{
DupPumpName(const std::string& what):
- std::runtime_error(std::string("DupPumpName: ") + what) {}
+ LLException(std::string("DupPumpName: ") + what) {}
};
/**
@@ -398,9 +418,9 @@ public:
/// group exceptions thrown by listen(). We use exceptions because these
/// particular errors are likely to be coding errors, found and fixed by
/// the developer even before preliminary checkin.
- struct ListenError: public std::runtime_error
+ struct ListenError: public LLException
{
- ListenError(const std::string& what): std::runtime_error(what) {}
+ ListenError(const std::string& what): LLException(what) {}
};
/**
* exception thrown by listen(). You are attempting to register a