Class ApiExceptions


  • public class ApiExceptions
    extends java.lang.Object
    A utility class for working with ApiException.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <ResponseT>
      ResponseT
      callAndTranslateApiException​(com.google.api.core.ApiFuture<ResponseT> future)
      Invokes Future.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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • callAndTranslateApiException

        public static <ResponseT> ResponseT callAndTranslateApiException​(com.google.api.core.ApiFuture<ResponseT> future)
        Invokes Future.get() on the given future, and if the call throws an exception (which will be UncheckedExecutionException), the exception is processed in the following way:
        1. 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.
        2. Otherwise, the UncheckedExecutionException is rethrown.