-
Notifications
You must be signed in to change notification settings - Fork 66
APIError not using pointer receiver #285
Copy link
Copy link
Closed
Description
APIError implementation of Error() does no use pointer receiver that while does not break errors.As it changes how you expect to use it.
_, err := db.w.Catalogs.GetByName(ctx, name)
if err != nil {
var apiErr *apierr.APIError
if errors.As(err, &apiErr)
// This block is never called
}
return false, fmt.Errorf("catalogExists: %w", err)
}I know that IsMissing is available to do this check but would seem better to have APIError work as expected.
Happy to open a PR if this is something that would be accepted
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels