-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Azure.Identity simplify exception messaging #9821
Conversation
sdk/identity/Azure.Identity/tests/DefaultAzureCredentialTests.cs
Outdated
Show resolved
Hide resolved
sdk/identity/Azure.Identity/tests/SharedTokenCacheCredentialTests.cs
Outdated
Show resolved
Hide resolved
sdk/identity/Azure.Identity/tests/SharedTokenCacheCredentialTests.cs
Outdated
Show resolved
Hide resolved
For me this is rather hard to read as a single line, I liked when messages were on separate lines |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Should we try and concatenate messages here? |
…nto identity-exmessagefix
Error messaging from authentication failures in Azure.Identity is in many cases too verbose. Nested exceptions and AggregateExceptions lead to duplicated information, and superfluous information being inserted into exception strings. This can often obscure the actual cause of the exception. This is especially true in error messages from the
DefaultAzureCredential
.This change simplifies exception messaging across the library and removes the use of
AggregateException
as the inner exception of failures from theDefaultAzureCredential
. Below are two examples of how this simplifies the exception messaging from theDefaultAzureCredential
.DefaultAzureCredential when no credentials are available
Without this update
With this update
DefaultAzureCredential when authentication fails
Without this update
With this update