> +
> +      try {
> +         if (input.getGateway().isPresent()) {
> +            AtomicReference<Operation> operation = new 
> AtomicReference<Operation>(api.getNetworkApiForProject(userProject
> +                    .get()).createInIPv4RangeWithGateway(input.getName(), 
> input.getIpV4Range(), input.getGateway().get()));
> +            retry(operationDonePredicate, operationCompleteCheckTimeout, 
> operationCompleteCheckInterval,
> +                    MILLISECONDS).apply(operation);
> +
> +            checkState(!operation.get().getHttpError().isPresent(), "Could 
> not create network, operation failed" + operation);
> +         } else {
> +            AtomicReference<Operation> operation = new 
> AtomicReference<Operation>(api.getNetworkApiForProject(userProject
> +                    .get()).createInIPv4Range(input.getName(), 
> input.getIpV4Range()));
> +            retry(operationDonePredicate, operationCompleteCheckTimeout, 
> operationCompleteCheckInterval,
> +                    MILLISECONDS).apply(operation);
> +
> +            checkState(!operation.get().getHttpError().isPresent(), "Could 
> not create network, operation failed" + operation);

I feel like I tried that and something went wrong, but I can try again if you 
want.

And again, I have no idea what the right exception to throw anywhere is. =)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/5/files#r7385857

Reply via email to