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

Uncaught email-already-in-use exception #27

Open
reesealanj opened this issue Dec 27, 2020 · 3 comments · May be fixed by #38
Open

Uncaught email-already-in-use exception #27

reesealanj opened this issue Dec 27, 2020 · 3 comments · May be fixed by #38

Comments

@reesealanj
Copy link

reesealanj commented Dec 27, 2020

I'm not sure where in the lit_firebase_auth this error is coming from (I've been looking for the last 2 hours trying to find the cause), but on version 0.3.0 running a call to context.registerWithEmailAndPassword() returns the following error, and Wrapping my call to context.registerWithEmailAndPassword() does not work because the exception is uncaught by the actual call to FirebaseAuth within the back end of the package. I'm not sure what else to try or if I'm missing something here.

Error:

[VERBOSE-2:ui_dart_state.cc(177)] Unhandled Exception: [firebase_auth/email-already-in-use] The email address is already in use by another account.
#0      catchPlatformException (package:firebase_auth_platform_interface/src/method_channel/utils/exception.dart:20:3)
#1      _rootRunUnary (dart:async/zone.dart:1198:47)
#2      _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#3      _FutureListener.handleError (dart:async/future_impl.dart:160:20)
#4      Future._propagateToListeners.handleError (dart:async/future_impl.dart:708:47)
#5      Future._propagateToListeners (dart:async/future_impl.dart:729:24)
#6      Future._completeError (dart:async/future_impl.dart:537:5)
#7      _AsyncAwaitCompleter.completeError (dart:async-patch/async_patch.dart:47:15)
#8      MethodChannel.invokeMapMethod (package:flutter/src/services/platform_channel.dart)
<asynchronous suspension>
#9      MethodChannelFirebaseAuth.createUserWithEmailAndPassword (package:firebase_auth_platform_interface/src/method_channel/method_c<…>

The exception here is not unrecoverable in that I can simply just return from my registration widget to the sign in widget and the application continues to behave as expected. The only reason this is actually an issue is that because the uncaught exception doesn't make it out to the try catch block that I have the call wrapped in, the call will make my signInForm just spin endlessly and the `context.isSubmitting()` is never updated so the UI never updates to show that the call has failed and so that I can handle the error.
@funwithflutter
Copy link
Owner

Do you have some example code so that I can replicate? I'll also take a look at the exception logic.

@orsenkucher
Copy link

@funwithflutter Basically it seems you just forgot to update _registerWithEmailAndPassword

Future<Auth> _registerWithEmailAndPassword(

with updating error handling commit refactor: update error handling with new core 2b15ba8

@orsenkucher orsenkucher linked a pull request Aug 20, 2021 that will close this issue
@orsenkucher
Copy link

@funwithflutter will you have time to merge the #38 fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants