Skip to content

feat(core): preserve and log the original Firebase error - #1522

Open
demolaf wants to merge 2 commits into
mainfrom
feat/preserve-firebase-error
Open

demolaf wants to merge 2 commits into
mainfrom
feat/preserve-firebase-error

Conversation

@demolaf

@demolaf demolaf commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Keeps the original Firebase error on FirebaseUIError and warns about configuration errors, so a translated message no longer hides the real cause.

Changes

  • FirebaseUIError keeps the original FirebaseError as cause, so apps can log or report the untranslated message.
  • handleFirebaseError logs Firebase configuration error codes, such as auth/api-key-expired, with console.warn.
  • Documents both in the README Error messages section.

Maintainer note: Fixes internal CPRN-594

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates FirebaseUIError to retain the original Firebase error as its cause and introduces warning logs for configuration-related errors. Corresponding unit tests and documentation updates have also been added. Feedback on these changes suggests optimizing the configuration error code lookup by using a Set instead of an array, handling already-wrapped FirebaseUIError instances in handleFirebaseError to prevent double-wrapping and duplicate warnings, and adding a test case to verify this behavior.

Comment thread packages/core/src/errors.ts Outdated
Comment thread packages/core/src/errors.ts
Comment thread packages/core/src/errors.test.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant