Skip to content
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

[FEATURE REQUEST] Problem Case without Type and wrap errors that are usable with erros.Is(...) #2488

Open
Dexus opened this issue Sep 10, 2024 · 1 comment
Assignees

Comments

@Dexus
Copy link

Dexus commented Sep 10, 2024

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

@kataras
Copy link
Owner

kataras commented Sep 10, 2024

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!

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

2 participants