use of org.gradle.tooling.internal.protocol.InternalBuildActionFailureException in project gradle by gradle.
the class ClientProvidedBuildActionRunner method buildResult.
private BuildActionResult buildResult(InternalBuildAction<?> clientAction, GradleInternal gradle, boolean isRunTasks) {
if (!isRunTasks) {
forceFullConfiguration(gradle);
}
InternalBuildController internalBuildController = new DefaultBuildController(gradle);
Object model = null;
Throwable failure = null;
try {
model = clientAction.execute(internalBuildController);
} catch (BuildCancelledException e) {
failure = new InternalBuildCancelledException(e);
} catch (RuntimeException e) {
failure = new InternalBuildActionFailureException(e);
}
PayloadSerializer payloadSerializer = getPayloadSerializer(gradle);
if (failure != null) {
return new BuildActionResult(null, payloadSerializer.serialize(failure));
} else {
return new BuildActionResult(payloadSerializer.serialize(model), null);
}
}
Aggregations