[firebase_auth_web] Exceptions returned are incompatible with mobile #2376
Labels
impact: customer
A bug with low impact (e.g. affecting only a few customers or has a workaround). (P3)
platform: web
Issues / PRs which are specifically for web.
plugin: auth
type: enhancement
New feature or request
Issue Summary.
Any exception thrown by
firebase_auth_web
is aFirebaseError
frompackage:firebase
. On mobile aPlatformError
is thrown instead. This makes it difficult to have cross-platform error handling logic.For example, the following logic works great on mobile for handling users attempting to sign in with an unrecognised email address. But to handle errors from web with similar type-safety requires importing the web-only
package:firebase
to get theFirebaseError
class, making it no longer mobile-compatible:(The error codes are also different between mobile and web for the same causes, but that's from the underlying Firebase library not FlutterFire).
Desired Solution
firebase_auth_web
should map anyFirebaseError
into aPlatformError
to provide API compatability and cross-platform support with the mobile implementation. Or perhapsFirebaseError
could be exposed as part ofpackage:firebase_core
or similar to avoid the need for a dependency on the web-onlypackage:firebase
.The text was updated successfully, but these errors were encountered: