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

feat(authenticator): Extend fromError in AuthException #72

Merged
merged 2 commits into from
Mar 18, 2024

Conversation

naipaka
Copy link
Contributor

@naipaka naipaka commented Mar 18, 2024

πŸ™Œ What I did

  • Extend fromError in AuthException to support non-FirebaseAuthException types
  • Remove toString method and message property from AuthException

✍️ What I didn't do

βœ… Verification

  • Android
  • iOS
  • macOS
  • Web

Screenshots

Additional Information

@naipaka naipaka requested a review from a team as a code owner March 18, 2024 02:46
@naipaka naipaka requested review from k-nkmr and removed request for a team March 18, 2024 02:46
@naipaka naipaka marked this pull request as draft March 18, 2024 02:46
@github-actions github-actions bot added the test label Mar 18, 2024
@@ -491,6 +491,30 @@ packages:
url: "https://pub.dev"
source: hosted
version: "4.8.1"
leak_tracker:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updates made with melos bs✍️

Comment on lines +6 to +9
factory AuthException.fromError(Object e) {
if (e is! FirebaseAuthException) {
return const AuthUndefinedError();
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To use the original AuthException.fromError, it was necessary to either:

  • Expose FirebaseAuthException
  • Allow receiving exceptions other than FirebaseAuthException

So, I implemented it with the latter!

Comment on lines -25 to -28
@override
String toString() => message;

String get message;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have removed message as it is often desired to be set by the user!

@@ -4,4 +4,4 @@ environment:
sdk: ^3.0.0

dev_dependencies:
melos: ^3.4.0
melos: ^5.1.0
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Additionally, I updated to the latest version of melos

@naipaka naipaka marked this pull request as ready for review March 18, 2024 02:52
Copy link
Member

@riscait riscait left a comment

Choose a reason for hiding this comment

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

LGTM
Thanks for all the improvements!

Copy link
Contributor

@k-nkmr k-nkmr left a comment

Choose a reason for hiding this comment

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

LGTM

@naipaka naipaka merged commit 95f0f23 into main Mar 18, 2024
5 checks passed
@naipaka naipaka deleted the support-non-firebase-auth-errors branch March 18, 2024 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants