File tree Expand file tree Collapse file tree 2 files changed +22
-6
lines changed
Utils/azuretools-core/src/com/microsoft/azuretools Expand file tree Collapse file tree 2 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -176,8 +176,6 @@ public AuthResult signIn(@Nullable AuthResult savedAuth) throws IOException {
176176 // Swallow the exception since some provided environments are not full featured
177177 LOGGER .warning ("Can't get " + env .resourceManagerEndpoint () + " access token from environment " +
178178 CommonSettings .getEnvironment ().getName ());
179- } else {
180- throw e ;
181179 }
182180 }
183181
@@ -188,8 +186,6 @@ public AuthResult signIn(@Nullable AuthResult savedAuth) throws IOException {
188186 // Swallow the exception since some provided environments are not full featured
189187 LOGGER .warning ("Can't get " + env .graphEndpoint () + " access token from environment " +
190188 CommonSettings .getEnvironment ().getName ());
191- } else {
192- throw e ;
193189 }
194190 }
195191
Original file line number Diff line number Diff line change 3939import com .microsoft .azuretools .utils .AzureRegisterProviderNamespaces ;
4040import com .microsoft .azuretools .utils .Pair ;
4141import com .microsoft .rest .credentials .ServiceClientCredentials ;
42+ import rx .Observable ;
4243
4344import java .io .IOException ;
45+ import java .util .Collections ;
4446import java .util .LinkedList ;
4547import java .util .List ;
4648import java .util .logging .Logger ;
@@ -113,12 +115,30 @@ public Settings getSettings() {
113115 }
114116
115117 public static List <Subscription > getSubscriptions (String tid ) throws IOException {
116- List <Subscription > sl = authTid (tid ).subscriptions ().list ();
118+ List <Subscription > sl = authTid (tid ).subscriptions ().listAsync ()
119+ .onErrorResumeNext (err -> {
120+ LOGGER .warning (err .getMessage ());
121+
122+ return Observable .empty ();
123+ })
124+ .toList ()
125+ .toBlocking ()
126+ .singleOrDefault (Collections .emptyList ());
127+
117128 return sl ;
118129 }
119130
120131 public static List <Tenant > getTenants (String tid ) throws IOException {
121- List <Tenant > tl = authTid (tid ).tenants ().list ();
132+ List <Tenant > tl = authTid (tid ).tenants ().listAsync ()
133+ .onErrorResumeNext (err -> {
134+ LOGGER .warning (err .getMessage ());
135+
136+ return Observable .empty ();
137+ })
138+ .toList ()
139+ .toBlocking ()
140+ .singleOrDefault (Collections .emptyList ());
141+
122142 return tl ;
123143 }
124144
You can’t perform that action at this time.
0 commit comments