[FIREBASE_AUTH] Consider strongly typing exceptions and/or returning results with errors #2653
Labels
blocked: customer-response
Waiting for customer response, e.g. more information was requested.
plugin: auth
resolution: needs-repro
This issue could not be reproduced or needs an up to date reproduction on latest FlutterFire plugin.
type: enhancement
New feature or request
I'm working with email/password authentication. I see that this process can fail for a number of reasons, and those failures are expressed as
PlatformException
s withcode
String
s.This is cumbersome for multiple reasons:
AuthResult
is already being returned. Why not use that object to represent failures, too?String
makes it easy to introduce typos when handling failures. It also requires that each app project create an enum for this purpose, or re-type theString
representation in multiple places.At a minimum, I would recommend strongly typing all error cases instead of using
String
s. But I would also recommend considering a request/response paradigm that doesn't treat common cases, like a bad password, as a language-level error.The text was updated successfully, but these errors were encountered: