Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
samber opened this issue Dec 31, 2024 · 0 comments
Open

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

samber opened this issue Dec 31, 2024 · 0 comments

Comments

@samber
Copy link
Owner

samber commented Dec 31, 2024

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant