-
Notifications
You must be signed in to change notification settings - Fork 345
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
Missing MsalClientException.NetworkNotAvailableError on iOS & Android #592
Comments
|
|
Will require a bit of refactoring. I assume this is possible especially with the latest updates in the dev branch. @bgavrilMS can you pls. take a look at this? |
@bgavrilMS : still relevant? Putting this in 4.3. |
I had a look at this and I propose we fix it by removing the custom exception from .net (this is a breaking behavioural change though), but then again so is the proposed change. I think the impact is minimal because MSAL will almost never throw this exception - if the Internet is down then one of the discovery calls will fail before getting to the WebUI logic. The reasons:
All in all, I don't think it's MSAL's responsibility to provide internet detection capabilities. App developers should not have to have special catch blocks for MSAL. This is easier: try
{
// call MSAL
// call some other logic that makes HTTP calls
}
catch HttpException
// Handle HTTP issues Than custom handling: try
{
// call MSAL
// call some other logic that makes HTTP calls
}
catch (MsalClientException ex) when ex.ErrorCode == NetworkIsDown
{
// handle MSAL
}
catch HttpException
{
// handle all other Http issues
} |
This makes sense to me. |
I'm ok with this. Only reason to consider leaving is the consideration for a major version bump. |
Fix for consistency means the library will not handle network down type of errors. |
Included in 4.3.0 release |
For platform Xamarin.iOS and Xamarin.Android there is no check for an available network connection in class WebUI. So in this case an HttpRequestException is thrown and not the expected MsalClientException with ErrorCode "NetworkNotAvailableError".
Please add an network connection check for this platforms to be consistent over all platforms.
The text was updated successfully, but these errors were encountered: