Skip to content

GetGroup does not return an error if the group doesn't exist #1095

@onetwopunch

Description

@onetwopunch

I'm not sure what the rationale for this was, but issuing a nil error while swallowing the actual error is non-standard Go practice, which in our case led to some unexpected results since we validated that err != nil. This function should instead issue a specific error for 404's and reference it with errors.Is.

if resp.StatusCode == http.StatusNotFound {
return nil, nil
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions