Transforming custom domain/application/infrastructure errors into huma HTTP errors #860
Unanswered
tomflenner
asked this question in
Q&A
Replies: 1 comment
-
|
I think it's somehow related to this : But I am not sure how I need to implement without loosing the full problem details. I would love to override only title, detail and status nothing more. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello 👋🏻 !
I am new to huma framework and thanks for bringing this to the community that looks really awesome 🔥.
Coming from a .NET background and quite not super familiar with go and idiomatic Go - I am currently testing huma for a side project.
Wanted to know what is the best way to transform custom errors that are in domain/application/infrastructure layers so basically some custom error that represent some failure in a use case into a huma http error.
For example :
into a
huma.Error404NotFoundThe idea is not to introduce huma framework in my domain/application/infrastructure layers and only keep that for the HTTP (API layer).
This may not be Go idiomatic but I would like to start like that.
Thanks a lot, feedback is appreciated if I am doing wrong Go here !🙏🏻
Beta Was this translation helpful? Give feedback.
All reactions