Skip to content

Always return error interface rather than specific types #2254

@jsha

Description

@jsha

In this excellent talk, Francesc Campoy recommends to always return the error interface for errors, rather than specific examples. This helps avoid tricky bugs related to the "non-nil interface can contain a boxed nil" pattern. We return *ProblemDetails in a few places, intending to more clearly document that those functions always return a *ProblemDetails, not some other error. However, we should probably change that.

Direct link to most relevant bit: https://youtu.be/ynoY2xz-F8s?t=699

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