org.cloudfoundry.AbstractCloudFoundryException Java Examples

The following examples show how to use org.cloudfoundry.AbstractCloudFoundryException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CloudControllerRestClientImpl.java    From cf-java-client-sap with Apache License 2.0 5 votes vote down vote up
private boolean isForbidden(Throwable t) {
    if (t instanceof AbstractCloudFoundryException) {
        AbstractCloudFoundryException e = (AbstractCloudFoundryException) t;
        return isForbidden(e);
    }
    return false;
}
 
Example #2
Source File: CloudControllerClientImpl.java    From cf-java-client-sap with Apache License 2.0 5 votes vote down vote up
private <T> T handleExceptions(Supplier<T> runnable) {
    try {
        return runnable.get();
    } catch (AbstractCloudFoundryException e) {
        throw convertV3ClientException(e);
    }
}
 
Example #3
Source File: CloudControllerClientImpl.java    From cf-java-client-sap with Apache License 2.0 5 votes vote down vote up
private <T> T handleUploadExceptions(UploadSupplier<T> runnable) throws IOException {
    try {
        return runnable.get();
    } catch (AbstractCloudFoundryException e) {
        throw convertV3ClientException(e);
    }
}
 
Example #4
Source File: CloudFoundryAppDeployer.java    From spring-cloud-app-broker with Apache License 2.0 4 votes vote down vote up
private Predicate<Throwable> httpStatusNotFoundPredicate() {
	return t -> t instanceof AbstractCloudFoundryException &&
		((AbstractCloudFoundryException) t).getStatusCode() == HttpStatus.NOT_FOUND.value();
}
 
Example #5
Source File: CloudFoundryManifestApplicationDeployer.java    From spring-cloud-skipper with Apache License 2.0 4 votes vote down vote up
public static Predicate<Throwable> isNotFoundError() {
	return t -> t instanceof AbstractCloudFoundryException
			&& ((AbstractCloudFoundryException) t).getStatusCode() == HttpStatus.NOT_FOUND.value();
}
 
Example #6
Source File: CloudControllerRestClientImpl.java    From cf-java-client-sap with Apache License 2.0 4 votes vote down vote up
private boolean isForbidden(AbstractCloudFoundryException e) {
    return e.getStatusCode() == HttpStatus.FORBIDDEN.value();
}
 
Example #7
Source File: CloudControllerClientImpl.java    From cf-java-client-sap with Apache License 2.0 4 votes vote down vote up
private CloudOperationException convertV3ClientException(AbstractCloudFoundryException e) {
    HttpStatus httpStatus = HttpStatus.valueOf(e.getStatusCode());
    return new CloudOperationException(httpStatus, httpStatus.getReasonPhrase(), e.getMessage(), e);
}
 
Example #8
Source File: AbstractCloudFoundryDeployer.java    From spring-cloud-deployer-cloudfoundry with Apache License 2.0 4 votes vote down vote up
Predicate<Throwable> isNotFoundError() {
	return t -> t instanceof AbstractCloudFoundryException && ((AbstractCloudFoundryException) t).getStatusCode() == HttpStatus.NOT_FOUND.value();
}