use of org.gradle.internal.exceptions.DefaultMultiCauseException in project gradle by gradle.
the class DefaultBuildOperationProcessor method doRun.
private <T extends BuildOperation> void doRun(BuildOperationWorker<T> worker, Action<BuildOperationQueue<T>> generator) {
BuildOperationQueue<T> queue = buildOperationQueueFactory.create(buildOperationWorkerRegistry.getCurrent(), fixedSizePool, worker);
List<GradleException> failures = Lists.newArrayList();
try {
generator.execute(queue);
} catch (Exception e) {
failures.add(new BuildOperationQueueFailure("There was a failure while populating the build operation queue: " + e.getMessage(), e));
queue.cancel();
}
try {
queue.waitForCompletion();
} catch (MultipleBuildOperationFailures e) {
failures.add(e);
}
if (failures.size() == 1) {
throw failures.get(0);
} else if (failures.size() > 1) {
throw new DefaultMultiCauseException(formatMultipleFailureMessage(failures), failures);
}
}
Aggregations