iris
iris copied to clipboard
[FEATURE REQUEST] Problem Case without Type and wrap errors that are usable with erros.Is(...)
Sample:
_, err := os.ReadFile("/tmp/dat_not_found")
newProblem := iris.NewProblem().Wrap(err)
ctx.StopWithProblem(
iris.StatusInternalError,
iris.NewProblem().
Key("error", true).
Key("success", false).
Title("Request failed").
Detail("Processing did not finish").
Cause(newProblem),
)
Maybe a Wrap thet will be output and one SilentWrap that is only for internal use.
Ref: https://github.com/mschneider82/problem/tree/master
Hello @Dexus, we can add a wrap method there. However, for your knowledge, I have redesigned the whole http errors idea in the upcoming version, you will be impressed by the innovation putted there!