public VAppTemplate apply(Exception from) { if (from instanceof AuthorizationException) { return null; } return propagateOrNull(from); } }
public Boolean apply(Exception from) { if (from instanceof AWSResponseException) { AWSResponseException responseException = (AWSResponseException) from; if ("BucketAlreadyOwnedByYou".equals(responseException.getError().getCode())) { return false; } } return Boolean.class.cast(propagateOrNull(from)); } }
public Boolean apply(Exception from) { if (from instanceof AzureStorageResponseException) { AzureStorageResponseException responseException = (AzureStorageResponseException) from; if ("ContainerAlreadyExists".equals(responseException.getError().getCode())) { return false; } } return Boolean.class.cast(propagateOrNull(from)); }
public Void apply(Exception from) { if (from instanceof AWSResponseException) { AWSResponseException e = (AWSResponseException) from; if (e.getError().getCode().equals("IncorrectState") && e.getError().getCode().contains("available")) return null; } return Void.class.cast(propagateOrNull(from)); }
public Boolean apply(Exception from) { List<Throwable> throwables = getCausalChain(from); Iterable<AWSResponseException> matchingAWSResponseException = filter(throwables, AWSResponseException.class); if (size(matchingAWSResponseException) >= 1 && get(matchingAWSResponseException, 0).getError() != null) { if (get(matchingAWSResponseException, 0).getError().getCode().equals("BucketNotEmpty")) return false; } Iterable<ContainerNotFoundException> matchingContainerNotFoundException = filter(throwables, ContainerNotFoundException.class); if (size(matchingContainerNotFoundException) >= 1) { return true; } if (returnValueOnCodeOrNull(from, true, equalTo(404)) != null) return true; return Boolean.class.cast(propagateOrNull(from)); } }