final Transform transform = transforms.get(config.transform());
Assert.nonNull(transform);
log.info(String.format("Launching transform '%s' with input directory '%s'", transform, inputDirectory));
try {
final TransformResult result = transform.run(task);
if (result.success()) {
log.info("Transform {} for task {} was run successfully.", transform, task);
}
else {
final String message = String.format("Failed to run transform: %s (task %s)", transform, task);
log.warn(message);
log.warn("STDERR: {}", StreamTool.consume(result.stderr(), StreamTool.UTF8));
throw Fail.hard(task, message, null);
}
}
catch (final InterruptedException e) {
throw Fail.soft(task, "Interrupted during run.", e);