use of won.bot.framework.eventbot.event.impl.lifecycle.ErrorEvent in project webofneeds by researchstudio-sat.
the class BaseEventBotAction method getActionTask.
@Override
public Runnable getActionTask(final Event event, final EventListener eventListener) {
return new Runnable() {
public void run() {
Stopwatch stopwatch = SimonManager.getStopwatch(stopwatchName);
Split split = stopwatch.start();
try {
doRun(event, eventListener);
split.stop();
} catch (Exception e) {
eventListenerContext.getEventBus().publish(new ErrorEvent(e));
split.stop(EXCEPTION_TAG);
} catch (Throwable t) {
logger.warn("could not run action {}", stopwatchName, t);
split.stop(EXCEPTION_TAG);
throw t;
}
}
};
}
Aggregations