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

errorutils does not work with wrapped errors #556

Open
Azuka opened this issue May 14, 2023 · 1 comment
Open

errorutils does not work with wrapped errors #556

Azuka opened this issue May 14, 2023 · 1 comment

Comments

@Azuka
Copy link

Azuka commented May 14, 2023

[REQUIRED] Step 2: Describe your environment

  • Operating System version: any
  • Firebase SDK version: v4
  • Library version: current
  • Firebase Product: auth

[REQUIRED] Step 3: Describe the problem

Related to #416, a wrapped firebase internal error cannot be introspected

Steps to reproduce:

fe, ok := err.(*FirebaseError)

Relevant Code:

// err works with errorutils.IsNotFound
_, err := authClient.GetUserByEmail(ctx, "[email protected]")
// errorutils.IsNotFound doesn't work
err = fmt.Errorf("[AuthService] %w")

Solution

Use errors.As instead of a simple typecast. I can open a pull request right away.

@google-oss-bot
Copy link
Collaborator

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

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