Conversation
AlexanderSher
commented
Apr 30, 2020
- Fix [BUG] Azure.Identity DefaultAzureCredential in Visual Studio fails when MFA required #11595: [BUG] Azure.Identity DefaultAzureCredential in Visual Studio fails when MFA required
- Fix [BUG] AzureConfigurationBuilder fails to build connection strings when deployed to App Service #11371: [BUG] AzureConfigurationBuilder fails to build connection strings when deployed to App Service
- Remove some dead code
…ual Studio fails when MFA required - Fix Azure#11371: [BUG] AzureConfigurationBuilder fails to build connection strings when deployed to App Service - Remove some dead code
…nto BugFixes # Conflicts: # sdk/identity/Azure.Identity/src/InteractiveBrowserCredential.cs # sdk/identity/Azure.Identity/src/ManagedIdentityClient.cs
|
#11371 is fixed in another PR |
| } | ||
|
|
||
| public AuthenticationFailedException FailAndWrap(Exception ex) | ||
| public Exception FailAndWrap(Exception ex) |
There was a problem hiding this comment.
Your not actually ever returning from this method. Perhaps it should have a void return type and be renamed to FailAndThrow?
There was a problem hiding this comment.
The problem is that if FailAndWrap method doesn't return exception, compiler requires to return something from catch statement. So while method doesn't return anything, it is the easiest way for caller to tell that exception is thrown.
| } | ||
|
|
||
| public AuthenticationFailedException FailAndWrap(Exception ex) | ||
| public Exception WrapAndThrow(Exception ex) |
There was a problem hiding this comment.
Perhaps I'm being a bit pedantic here but I think the name should be FailAndThrow rather than WrapAndThrow. My reasoning behind this is that this is an instance method on CredentialDiagnosticScope and the high order bit is that we are "failing" the diagnostic scope and then we are throwing the exception (possibly wrapped). If you want to be most precise you could also call it FailWrapAndThrow but this might be a bit long winded.
There was a problem hiding this comment.
Changed to FailWrapAndThrow