Skip to content
This repository has been archived by the owner on May 16, 2021. It is now read-only.

Commit

Permalink
fix: check for error before wrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
mainawycliffe committed Dec 10, 2019
1 parent 05a50f9 commit 13c536b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions firebase/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,13 @@ func DeleteFirebaseUser(ctx context.Context, uid string) error {
return fmt.Errorf("Error authenticating firebase account: %w", err)
}
err = client.DeleteUser(ctx, uid)
if auth.IsUserNotFound(err) {
return fmt.Errorf("User not found!")
if err != nil {
if auth.IsUserNotFound(err) {
return fmt.Errorf("User not found!")
}
return fmt.Errorf("An unnkown error: %w", err)
}
return fmt.Errorf("An unnkown error: %w", err)
return nil
}

// ListAllFirebaseUsers get all users in firebase auth
Expand Down

0 comments on commit 13c536b

Please sign in to comment.