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:
@@ -202,25 +202,26 @@ public class PresentsDObjectMgr
|
|||||||
start = _timer.highResCounter();
|
start = _timer.highResCounter();
|
||||||
}
|
}
|
||||||
|
|
||||||
// if this is a runnable, it's just an executable unit that
|
try {
|
||||||
// should be invoked
|
if (unit instanceof Runnable) {
|
||||||
if (unit instanceof Runnable) {
|
// if this is a runnable, it's just an executable unit
|
||||||
try {
|
// that should be invoked
|
||||||
((Runnable)unit).run();
|
((Runnable)unit).run();
|
||||||
} catch (Exception e) {
|
|
||||||
Log.warning("Execution unit failed [unit=" + unit + "].");
|
} else if (unit instanceof CompoundEvent) {
|
||||||
Log.logStackTrace(e);
|
processCompoundEvent((CompoundEvent)unit);
|
||||||
} catch (OutOfMemoryError oome) {
|
|
||||||
handleFatalError(unit, oome);
|
} else {
|
||||||
} catch (StackOverflowError soe) {
|
processEvent((DEvent)unit);
|
||||||
handleFatalError(unit, soe);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (unit instanceof CompoundEvent) {
|
} catch (Exception e) {
|
||||||
processCompoundEvent((CompoundEvent)unit);
|
Log.warning("Execution unit failed [unit=" + unit + "].");
|
||||||
|
Log.logStackTrace(e);
|
||||||
} else {
|
} catch (OutOfMemoryError oome) {
|
||||||
processEvent((DEvent)unit);
|
handleFatalError(unit, oome);
|
||||||
|
} catch (StackOverflowError soe) {
|
||||||
|
handleFatalError(unit, soe);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (start != 0L) {
|
if (start != 0L) {
|
||||||
|
|||||||
Reference in New Issue
Block a user