-
Notifications
You must be signed in to change notification settings - Fork 187
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] Raise errors for HTTP error codes in the generic client #927
Comments
@dblock I would really want to understand why we should do that, in particular what would be the reason to use generic HTTP client vs typed client - if both would do the same thing? (at least with respect to exception handling). We should not forget that, if we decided to pursue this path, the exception should include the response body + status (at least), otherwise we are missing important details. |
|
I think the exception should include the entire |
Fair points, thanks @dblock, I think we could accommodate both favours while building the client, very roughly something like that:
|
Yes, it's certainly acceptable! That's my alternate option. It's still not my preferred, but I would be ok with it. Want to try to PR it? |
My general expectation if using an untyped client in Java is that if the server returned a response (regardless of HTTP status code) then I will get that response without having to unwrap exceptions, and an exception would only model cases where the request can't be sent or a response is never received. I fully admit I may be in the minority here. |
We are :D But it is good to provide options .... |
Is your feature request related to a problem?
Coming from #910 (comment) I propose we raise errors on non-2xx error codes from the server for the generic client just like in the rest of the java client.
What solution would you like?
Currently:
Proposed:
What alternatives have you considered?
Do you have any additional context?
Let's discuss/implement/close/reject this issue before #926
The text was updated successfully, but these errors were encountered: