Class ApiExceptions (2.22.0)

publicclassApiExceptions

Inheritance

java.lang.Object >ApiExceptions

Static Methods

<ResponseT>callAndTranslateApiException(ApiFuture<ResponseT> future)

publicstaticResponseT<ResponseT>callAndTranslateApiException(ApiFuture<ResponseT>future)

InvokesApiFuture#get() on the given future, and if the call throws an exception (which will beUncheckedExecutionException), the exception is processed in the following way:

  1. If the exception cause is a RuntimeException, the RuntimeException is rethrown. To ease debugging, the aAsyncTaskException is added as a suppressed exception to maintain the callsite.
  2. Otherwise, the UncheckedExecutionException is rethrown.
Parameter
NameDescription
futureApiFuture<ResponseT>
Returns
TypeDescription
ResponseT

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-17 UTC.