Skip to content

Errors are not wrapped with %w #123

@marc-harrison

Description

@marc-harrison

Errors like:

return Flags{}, &FlagsmithAPIError{msg: fmt.Sprintf("flagsmith: error performing request to Flagsmith API: %s", err)}

Are not wrapped with %w e.g.

return Flags{}, &FlagsmithAPIError{msg: fmt.Sprintf("flagsmith: error performing request to Flagsmith API: %w", err)}

This makes handling errors like -

  Failed to fetch flags with error:
    flagsmith:
      error performing request to Flagsmith API:
        Post "https://api.flagsmith.com/api/v1/identities/":
          context deadline exceeded (Client.Timeout exceeded while awaiting headers)

a challenge. I'm happy to make a PR there's 5 places.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions