Skip to content

[Proposal] Add the log level to the error builder #42

Open
@samber

Description

@samber

What about adding a .Level(slog.Level) method to the error builder?

Pros:

  • When I build an error in a nested function, the caller cannot differentiate between an acceptable error (warning?) and a blocking error (error).
  • An HTTP status 404 is a warning while a 500 is an error, but both are considered errors by the HTTP frameworks.

Cons:

  • The log level is a logger thing, while this library provides an error builder. The separation of concern is not fully respected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions