Skip to content

[firebase_auth_web] handle exception as documented in platform interface. #1559

Closed
@GregorySech

Description

@GregorySech

Describe the bug
Exceptions in the web implementation are not catchable using the platform interface.

To Reproduce
Steps to reproduce the behavior:

  1. Create an empty flutter project using master
  2. Setup firebase_auth and firebase_auth_web following the web package README. (I didn't activate email auth provider to make sure of getting an API error).
  3. Place a try catch block to catch a possible error using AuthException
  4. Try to cause the expected error. I tried to authenticate with email and password without activating the email provider to cause ERROR_OPERATION_NOT_ALLOWED.

Expected behavior
I expect the try catch to trigger but it gets ignored. The error is instead reported in the development console as "uncaught in Promise".

Additional context
I'm working on a fix. I will create an "exception mapper" from package:firebase's FirebaseError to AuthException using this reference.

I'm working on the mapping here https://docs.google.com/spreadsheets/d/1VrmcLK3-KF5_DK732XDA0G64wxgiP4W3KvwxeP6Y_DA/edit?usp=sharing

Metadata

Metadata

Assignees

No one assigned

    Labels

    blocked: customer-responseWaiting for customer response, e.g. more information was requested.platform: webIssues / PRs which are specifically for web.plugin: authresolution: needs-reproThis issue could not be reproduced or needs an up to date reproduction on latest FlutterFire plugin.type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions