Skip to content
This repository was archived by the owner on May 15, 2024. It is now read-only.

[iOS] [WebAuth] Correctly interpret iOS WebAuthenticator errors#1507

Merged
mattleibow merged 5 commits intomainfrom
dev/ios-auth
Nov 10, 2020
Merged

[iOS] [WebAuth] Correctly interpret iOS WebAuthenticator errors#1507
mattleibow merged 5 commits intomainfrom
dev/ios-auth

Conversation

@mattleibow
Copy link
Copy Markdown
Member

@mattleibow mattleibow commented Nov 7, 2020

Description of Change

When using ASWebAuthenticationSession and SFAuthenticationSession, the cancellation operations are marked by iOS throwing an exception. This PR catches those errors and then converts them into cancellation exceptions.

I also removed the containing try/catch block as that was actually catching the exceptions that were set in the TaskCompletionSource and then re-throwing them.

Bugs Fixed

API Changes

None.

Behavioral Changes

iOS cancellation errors are now exposed as .NET cancellation exceptions.

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Has samples (if omitted, state reason in description)
  • Rebased on top of main at time of PR
  • Changes adhere to coding standard
  • Updated documentation (see walkthrough)

- Don't catch our own errors and then throw them
- Correctly convert from cancellation NSErrors into .NET cancellation exceptions
- Fixes #1240
@mattleibow mattleibow added this to the 1.6.0 milestone Nov 7, 2020
@mattleibow mattleibow changed the title Correctly interpret iOS WebAuthenticator errors [iOS] [WebAuth] Correctly interpret iOS WebAuthenticator errors Nov 10, 2020
@mattleibow mattleibow merged commit a8b1898 into main Nov 10, 2020
@mattleibow mattleibow deleted the dev/ios-auth branch November 10, 2020 15:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

1 participant