errorutils does not work with wrapped errors
Azuka opened this issue · comments
[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:
firebase-admin-go/internal/errors.go
Line 100 in 61c6c04
Relevant Code:
// err works with errorutils.IsNotFound
_, err := authClient.GetUserByEmail(ctx, "example@example.com")
// 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.
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.