} else if (failure instanceof GradleConnectionException) {
handler.onFailure((GradleConnectionException) failure);
} 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));
}
}