public <T> T run(final BuildAction<T> action, ConsumerOperationParameters operationParameters)
throws UnsupportedOperationException, IllegalStateException {
BuildResult<T> result;
try {
try {
result = executor.run(new InternalBuildActionAdapter<T>(action, adapter), new BuildCancellationTokenAdapter(operationParameters.getCancellationToken()), operationParameters);
} catch (RuntimeException e) {
throw exceptionTransformer.transform(e);
}
} catch (InternalBuildActionFailureException e) {
throw new BuildActionFailureException("The supplied build action failed with an exception.", e.getCause());