Examples of GradleConnectionException


Examples of org.gradle.tooling.GradleConnectionException

        } else if (failure instanceof InternalBuildCancelledException) {
            handler.onFailure(new BuildCancelledException(connectionFailureMessage(failure), failure.getCause()));
        } else if (failure instanceof BuildExceptionVersion1) {
            handler.onFailure(new BuildException(connectionFailureMessage(failure), failure.getCause()));
        } else {
            handler.onFailure(new GradleConnectionException(connectionFailureMessage(failure), failure));
        }
    }
View Full Code Here

Examples of org.gradle.tooling.GradleConnectionException

                        } catch (FileNotFoundException e) {
                            throw new IllegalArgumentException(String.format("The specified %s does not exist.", getDisplayName()), e);
                        } catch (CancellationException e) {
                            throw new BuildCancelledException(String.format("Distribution download cancelled. Using distribution from '%s'.", wrapperConfiguration.getDistribution()), e);
                        } catch (Exception e) {
                            throw new GradleConnectionException(String.format("Could not install Gradle distribution from '%s'.", wrapperConfiguration.getDistribution()), e);
                        }
                        return installDir;
                    }
                };
                File installDir;
                ExecutorService executor = null;
                try {
                    executor = executorFactory.create();
                    final Future<File> installDirFuture = executor.submit(installDistroTask);
                    cancellationToken.addCallback(new Runnable() {
                        public void run() {
                            // TODO(radim): better to close the connection too to allow quick finish of the task
                            installDirFuture.cancel(true);
                        }
                    });
                    installDir = installDirFuture.get();
                } catch (CancellationException e) {
                    throw new BuildCancelledException(String.format("Distribution download cancelled. Using distribution from '%s'.", wrapperConfiguration.getDistribution()), e);
                } catch (InterruptedException e) {
                    throw new GradleConnectionException(String.format("Could not install Gradle distribution from '%s'.", wrapperConfiguration.getDistribution()), e);
                } catch (ExecutionException e) {
                    if (e.getCause() != null) {
                        UncheckedException.throwAsUncheckedException(e.getCause());
                    }
                    throw new GradleConnectionException(String.format("Could not install Gradle distribution from '%s'.", wrapperConfiguration.getDistribution()), e);
                } finally {
                    if (executor != null) {
                        executor.shutdown();
                    }
                }
View Full Code Here

Examples of org.gradle.tooling.GradleConnectionException

            }
            return adaptedConnection;
        } catch (UnsupportedVersionException e) {
            throw e;
        } catch (Throwable t) {
            throw new GradleConnectionException(String.format("Could not create an instance of Tooling API implementation using the specified %s.", distribution.getDisplayName()), t);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.