Package com.google.api.gax.rpc
Class ApiExceptions
- java.lang.Object
-
- com.google.api.gax.rpc.ApiExceptions
-
public class ApiExceptions extends Object
A utility class for working withApiException.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <ResponseT>
ResponseTcallAndTranslateApiException(ApiFuture<ResponseT> future)InvokesFuture.get()on the given future, and if the call throws an exception (which will beUncheckedExecutionException), the exception is processed in the following way: If the exception cause is a RuntimeException, the RuntimeException is rethrown.
-
-
-
Method Detail
-
callAndTranslateApiException
public static <ResponseT> ResponseT callAndTranslateApiException(ApiFuture<ResponseT> future)
InvokesFuture.get()on the given future, and if the call throws an exception (which will beUncheckedExecutionException), the exception is processed in the following way:- If the exception cause is a RuntimeException, the RuntimeException is rethrown. To ease
debugging, the a
AsyncTaskExceptionis added as a suppressed exception to maintain the callsite. - Otherwise, the UncheckedExecutionException is rethrown.
- If the exception cause is a RuntimeException, the RuntimeException is rethrown. To ease
debugging, the a
-
-