Skip to content

Commit

Permalink
Fix AzureOperationException: get details of all cached subscriptions (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenba authored Apr 12, 2021
1 parent 99dfe83 commit 9503d56
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.microsoft.azure.management.resources.Subscription;
import com.microsoft.azure.management.resources.Tenant;
import com.microsoft.azure.toolkit.lib.common.operation.AzureOperation;
import com.microsoft.azure.toolkit.lib.common.operation.AzureOperationException;
import com.microsoft.azure.toolkit.lib.common.rest.RestExceptionHandlerInterceptor;
import com.microsoft.azuretools.adauth.AuthException;
import com.microsoft.azuretools.authmanage.*;
Expand Down Expand Up @@ -137,6 +138,13 @@ public List<Pair<Subscription, Tenant>> getSubscriptionsWithTenant() {
Throwables.getCausalChain(e).stream().anyMatch(tenantError)) {
// TODO: @wangmi better to notify user
LOGGER.log(Level.WARNING, e.getMessage(), e);
} else if (e instanceof AzureOperationException) {
// TODO: @maartenba/@sdubov
// This is where upstream issue happens:
// https://github.com/microsoft/azure-tools-for-java/issues/5053
// https://github.com/microsoft/azure-tools-for-java/issues/4977
// Next merge, see if upstream has been updated.
LOGGER.log(Level.SEVERE, e.getMessage(), e);
} else {
throw e;
}
Expand Down

0 comments on commit 9503d56

Please sign in to comment.