Skip to content

errorutils does not work with wrapped errors #556

@Azuka

Description

@Azuka

[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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions