https://github.com/GoogleCloudPlatform/google-cloud-java/blob/e5f90467fe7490759482e6a8bc62b1246318a7f0/google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java#L437
In case of quota exhaustion, Exception is thrown from RPC. Catch doesn't distinguish and thus assumes it's not running on GAE.
Would it be sufficient to catch ClassNotFoundException and related (e.g. NoSuchMethodException) to detect if we're on GAE? Like this, RPC-related exceptions (from within the called method) could bubble up properly.
https://github.com/GoogleCloudPlatform/google-cloud-java/blob/e5f90467fe7490759482e6a8bc62b1246318a7f0/google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java#L437
In case of quota exhaustion, Exception is thrown from RPC. Catch doesn't distinguish and thus assumes it's not running on GAE.
Would it be sufficient to catch ClassNotFoundException and related (e.g. NoSuchMethodException) to detect if we're on GAE? Like this, RPC-related exceptions (from within the called method) could bubble up properly.