go-fuego / fuego

Golang Fuego - web framework generating OpenAPI 3 spec from source code
https://go-fuego.github.io/fuego/
MIT License
924 stars 47 forks source link

feat: add ErrorWithDetail #228

Open dylanhitt opened 5 days ago

dylanhitt commented 5 days ago

Closes #225

Adds ErrorWithDetail interface to allow for response of detail. This is similar to the older with Info. The motivation for this is the fact that we use the detail option in the slog.Error in the default error handler as well as in the HTTPError.Error() func. Maybe we should default into something as well in the case where the user doesn't supply it.

If this is acceptable I will update the docs now as well.

dylanhitt commented 4 days ago

@EwenQuim should I update the docs?