Flutter/Dart & Firebase Error Messages & Codes

1,028

it is available. the problem is that the catchError value is not an object, so you can't loop thru its keys. print/debugPrint just outputs the values without giving you any clue how to reference only one of them.

it has getter methods - code, message, and...details. 'details' is the human-readable result, but it's not documented on the firebase_auth flutter example. do this:

}).catchError((e) {
  print(e.details); // code, message, details
});
Share:
1,028
Josh Kahane
Author by

Josh Kahane

Updated on December 05, 2022

Comments

  • Josh Kahane
    Josh Kahane over 1 year

    I am implementing Firebase Auth into my Flutter app. How do I access error codes or user friendly error messages from Firebase? Is this available yet?

    For example, on iOS you can get the localisedDescription from an error.

    In Dart I have a onError: and catchError Futures which return an error object, but don't appear to have the relevant associated information.

    • creativecreatorormaybenot
      creativecreatorormaybenot almost 6 years
      print, debugPrint