Make sure to catch any error while processing our events, not just when

actually dispatching the event to subscribers. We can't trust anyone.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3308 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2005-01-24 07:59:31 +00:00
parent 05d72fb406
commit be93e5eb12
@@ -202,25 +202,26 @@ public class PresentsDObjectMgr
start = _timer.highResCounter();
}
// if this is a runnable, it's just an executable unit that
// should be invoked
if (unit instanceof Runnable) {
try {
try {
if (unit instanceof Runnable) {
// if this is a runnable, it's just an executable unit
// that should be invoked
((Runnable)unit).run();
} catch (Exception e) {
Log.warning("Execution unit failed [unit=" + unit + "].");
Log.logStackTrace(e);
} catch (OutOfMemoryError oome) {
handleFatalError(unit, oome);
} catch (StackOverflowError soe) {
handleFatalError(unit, soe);
} else if (unit instanceof CompoundEvent) {
processCompoundEvent((CompoundEvent)unit);
} else {
processEvent((DEvent)unit);
}
} else if (unit instanceof CompoundEvent) {
processCompoundEvent((CompoundEvent)unit);
} else {
processEvent((DEvent)unit);
} catch (Exception e) {
Log.warning("Execution unit failed [unit=" + unit + "].");
Log.logStackTrace(e);
} catch (OutOfMemoryError oome) {
handleFatalError(unit, oome);
} catch (StackOverflowError soe) {
handleFatalError(unit, soe);
}
if (start != 0L) {