Skip to content
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

catch MsalClientException when user cancels auth instead of serviceEx… #587

Merged
merged 5 commits into from Jul 5, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -258,6 +258,12 @@ private void VerifyAuthorizationResult()
MsalErrorMessage.NoPromptFailedErrorMessage);
}

if (_authorizationResult.Status == AuthorizationStatus.UserCancel)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you look at adding tests for this class? A unit tests should have failed when you added these lines, but it clearly did not since the PR passed. I think it is important to lock this down with unit tests because the exceptions we throw are part of the public API, i.e. if we throw a different exception from one release to the other we have broken customers' handling code.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

{
throw new MsalClientException(_authorizationResult.Error,
_authorizationResult.ErrorDescription);
}

if (_authorizationResult.Status != AuthorizationStatus.Success)
{
throw new MsalServiceException(_authorizationResult.Error,
Expand Down