public class ApiExceptions
A utility class for working with ApiException.
Static Methods
<ResponseT>callAndTranslateApiException(ApiFuture<ResponseT> future)
public static ResponseT <ResponseT>callAndTranslateApiException(ApiFuture<ResponseT> future)
Invokes ApiFuture#get() on the given future, and if the call throws an exception (which will be UncheckedExecutionException), the exception is processed in the following way:
- If the exception cause is a RuntimeException, the RuntimeException is rethrown. To ease debugging, the a AsyncTaskException is added as a suppressed exception to maintain the callsite.
- Otherwise, the UncheckedExecutionException is rethrown.
Parameter | |
---|---|
Name | Description |
future |
ApiFuture<ResponseT> |
Returns | |
---|---|
Type | Description |
ResponseT |