@Override protected void onExecuteError(Throwable exception, ExecutableContext executableContext) { super.onExecuteError(exception, executableContext); onStatusChange(executableContext, ExecuteResult.createError(exception), ExecutableState.ERROR); }
onExecuteError(realException, executableContext); throw new ExecuteException(realException);
@Override public final ExecuteResult execute(ExecutableContext executableContext) throws ExecuteException { //print a eye-catching title in log LogTitlePrinter.printTitle(this.getName()); Preconditions.checkArgument(executableContext instanceof DefaultContext); ExecuteResult result; try { onExecuteStart(executableContext); result = doWork(executableContext); } catch (Throwable e) { logger.error("error running Executable", e); onExecuteError(e, executableContext); throw new ExecuteException(e); } onExecuteFinished(result, executableContext); return result; }
@Override protected void onExecuteError(Throwable exception, ExecutableContext executableContext) { super.onExecuteError(exception, executableContext); onStatusChange(executableContext, ExecuteResult.createError(exception), ExecutableState.ERROR); }
@Override public final ExecuteResult execute(ExecutableContext executableContext) throws ExecuteException { //print a eye-catching title in log LogTitlePrinter.printTitle(this.getName()); Preconditions.checkArgument(executableContext instanceof DefaultContext); ExecuteResult result; try { onExecuteStart(executableContext); result = doWork(executableContext); } catch (Throwable e) { logger.error("error running Executable", e); onExecuteError(e, executableContext); throw new ExecuteException(e); } onExecuteFinished(result, executableContext); return result; }
onExecuteError(realException, executableContext); throw new ExecuteException(realException);