Skip to content

Commit 2a6ca02

Browse files
Expands APIC plugins exception handling
1 parent adf6d2d commit 2a6ca02

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

dev-proxy-plugins/RequestLogs/ApiCenterOnboardingPlugin.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,7 @@ public override void Register(IPluginEvents pluginEvents,
142142
{
143143
_ = authenticationHandler.GetAccessToken(CancellationToken.None).Result;
144144
}
145-
catch (Exception ex) when
146-
// dev credential
147-
(ex is AuthenticationFailedException ||
148-
// prod credential
149-
ex is AggregateException && ex.InnerException is CredentialUnavailableException)
145+
catch (Exception ex)
150146
{
151147
_logger?.LogError(ex, "Failed to authenticate with Azure. The {plugin} will not be used.", Name);
152148
return;

dev-proxy-plugins/RequestLogs/ApiCenterProductionVersionPlugin.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,7 @@ public override void Register(IPluginEvents pluginEvents,
153153
{
154154
_ = authenticationHandler.GetAccessToken(CancellationToken.None).Result;
155155
}
156-
catch (Exception ex) when
157-
// dev credential
158-
(ex is AuthenticationFailedException ||
159-
// prod credential
160-
ex is AggregateException && ex.InnerException is CredentialUnavailableException)
156+
catch (Exception ex)
161157
{
162158
_logger?.LogError(ex, "Failed to authenticate with Azure. The {plugin} will not be used.", Name);
163159
return;

0 commit comments

Comments
 (0)