use of org.embulk.exec.PartialExecutionException in project embulk by embulk.
the class EmbulkEmbed method run.
public ExecutionResult run(ConfigSource config) {
this.logger.info("Started Embulk v" + EmbulkVersion.VERSION);
ExecSession exec = newExecSession(config);
try {
return bulkLoader.run(exec, config);
} catch (PartialExecutionException partial) {
try {
bulkLoader.cleanup(config, partial.getResumeState());
} catch (Throwable ex) {
partial.addSuppressed(ex);
}
throw partial;
} finally {
try {
exec.cleanup();
} catch (Exception ex) {
// TODO add this exception to ExecutionResult.getIgnoredExceptions
// or partial.addSuppressed
ex.printStackTrace(System.err);
}
}
}
use of org.embulk.exec.PartialExecutionException in project embulk by embulk.
the class EmbulkEmbed method runResumable.
public ResumableResult runResumable(ConfigSource config) {
this.logger.info("Started Embulk v" + EmbulkVersion.VERSION);
ExecSession exec = newExecSession(config);
try {
ExecutionResult result;
try {
result = bulkLoader.run(exec, config);
} catch (PartialExecutionException partial) {
return new ResumableResult(partial);
}
return new ResumableResult(result);
} finally {
try {
exec.cleanup();
} catch (Exception ex) {
// TODO add this exception to ExecutionResult.getIgnoredExceptions
// or partial.addSuppressed
ex.printStackTrace(System.err);
}
}
}
Aggregations