Skip to content

Commit

Permalink
Expands APIC plugins exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
waldekmastykarz committed May 13, 2024
1 parent adf6d2d commit 2a6ca02
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
6 changes: 1 addition & 5 deletions dev-proxy-plugins/RequestLogs/ApiCenterOnboardingPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,7 @@ public override void Register(IPluginEvents pluginEvents,
{
_ = authenticationHandler.GetAccessToken(CancellationToken.None).Result;
}
catch (Exception ex) when
// dev credential
(ex is AuthenticationFailedException ||
// prod credential
ex is AggregateException && ex.InnerException is CredentialUnavailableException)
catch (Exception ex)
{
_logger?.LogError(ex, "Failed to authenticate with Azure. The {plugin} will not be used.", Name);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,7 @@ public override void Register(IPluginEvents pluginEvents,
{
_ = authenticationHandler.GetAccessToken(CancellationToken.None).Result;
}
catch (Exception ex) when
// dev credential
(ex is AuthenticationFailedException ||
// prod credential
ex is AggregateException && ex.InnerException is CredentialUnavailableException)
catch (Exception ex)
{
_logger?.LogError(ex, "Failed to authenticate with Azure. The {plugin} will not be used.", Name);
return;
Expand Down

0 comments on commit 2a6ca02

Please sign in to comment.