Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include the original firebase exception message #781

Open
yowaiOtoko opened this issue Mar 28, 2023 · 1 comment
Open

Include the original firebase exception message #781

yowaiOtoko opened this issue Mar 28, 2023 · 1 comment
Assignees

Comments

@yowaiOtoko
Copy link

yowaiOtoko commented Mar 28, 2023

Describe the feature you would like to see

Include the original firebase exception message in exception properties, EMAIL_EXISTS for example. This would enable to handle translation of the error messages based on this key.
The only way right now is to use this bundle english translation as a translation key.
interface FirebaseException extends Throwable { public function getMessageKey(): string; }

trait HasMessageKey
{
    /** @var string */
    protected string $messageKey = '';

    /** @return string */
    public function getMessageKey(): string
    {
        return $this->messageKey;
    }
}

Is this the way to go ?

@jeromegamez
Copy link
Member

That's a great idea! I wouldn't go with messageKey, though, but rather go with something similar to the Node Admin SDK . Let me see what I can come up with, but I think it will be something like errorCode() or something like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants