Flutter firebase handling exceptions
I am trying to catch the exceptions thrown by Firebase (from failed login) to flutter but I am having zero luck. .catcherror seems to print out the error but an exception is still crashing my code. I have found similar issues in other posts but no answers seem to help me, it's making my code unusable, thank you so much.
try { signIn(typedemail, typedpassword).catchError((e) {
print(e);
print(e.message.toString()+"rrrrr");
print(e.code);
print(e.details);
}); }
on PlatformException catch (e) {
print("on worked");//this doesnt work }
finally{
print("finally");
}
And I get this if I disable breaking on exceptions
D/FirebaseApp(11795): Notified 0 auth state listeners.
I/flutter (11795): PlatformException(exception, The email address is badly
formatted., null)
I/flutter (11795): The email address is badly formatted.rrrrr
I/flutter (11795): exception
I/flutter (11795): null
try { signIn(typedemail, typedpassword).catchError((e) {
print(e);
print(e.message.toString()+"rrrrr");
print(e.code);
print(e.details);
}); }
on PlatformException catch (e) {
print("on worked");//this doesnt work }
finally{
print("finally");
}
And I get this if I disable breaking on exceptions
D/FirebaseApp(11795): Notified 0 auth state listeners.
I/flutter (11795): PlatformException(exception, The email address is badly
formatted., null)
I/flutter (11795): The email address is badly formatted.rrrrr
I/flutter (11795): exception
I/flutter (11795): null
Comments
Post a Comment