public void onFailure(Throwable failure) {
if (failure instanceof InternalUnsupportedBuildArgumentException) {
handler.onFailure(new UnsupportedBuildArgumentException(connectionFailureMessage(failure)
+ "\n" + failure.getMessage(), failure));
} else if (failure instanceof UnsupportedOperationConfigurationException) {
handler.onFailure(new UnsupportedOperationConfigurationException(connectionFailureMessage(failure)
+ "\n" + failure.getMessage(), failure.getCause()));
} else if (failure instanceof GradleConnectionException) {
handler.onFailure((GradleConnectionException) failure);
} else if (failure instanceof InternalBuildCancelledException) {
handler.onFailure(new BuildCancelledException(connectionFailureMessage(failure), failure.getCause()));