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

Dump Request/Response On HTTP Response Code >= 300 #324

Closed
wonderstim opened this issue May 1, 2024 · 2 comments · May be fixed by #397
Closed

Dump Request/Response On HTTP Response Code >= 300 #324

wonderstim opened this issue May 1, 2024 · 2 comments · May be fixed by #397
Labels
enhancement New feature or request needs response

Comments

@wonderstim
Copy link

Is your feature request related to a problem? Please describe.
In dev I just always have debug on. I can't do that in production obviously, but because the API is generated it is actually pretty annoying to dump requests bodies from failed requests. This is particularly annoying when I am seeing 422 errors where the invalid parameters array is also empty.

Describe the solution you'd like
Similar to the debug configuration, just an option for dumping reqeusts and responses is the HTTP status code is not 2XX

Describe alternatives you've considered
Manually json marshaling each and every input on a returned error. This is a LOT of copy/pasted code.

Additional context
Add any other context or screenshots about the feature request here.

@gcatanese
Copy link
Contributor

@wonderstim Hey Tim, I have created a PR to address the shortcoming, please let me know what you think.

Our long-term solution is to unify the error handling of all APIs so that we will be able to expose consistently any error using the same object (model) with all the necessary info (i.e. InvalidFields)

@wonderstim
Copy link
Author

Ok I will try it out in the new year. We are in code freeze for the holidays atm. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs response
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants