Skip to content

Use 'panic', not 'error' #245

Open
Open
@langston-barrett

Description

There are many places in the codebase where we use error, but panic would be more appropriate. These instances usually represent something the implementor believes is a bug or would be impossible, and panic (1) tells users that it's not their fault and (2) provides users with a suggestion of what to do: file a bug.

I would suggest adding the following to our .hlint.yaml, so we discourage this pattern in the future:

- error:
    lhs: "error x"
    rhs: 'panic "nameOfFunction" [x, "more lines of details"]'

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