quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.81k stars 2.69k forks source link

Rest-client throw a "HTTP 400 Bad Request" instead of "Bad Response From Server" #32710

Closed benDeMtp closed 1 year ago

benDeMtp commented 1 year ago

Describe the bug

With quarkus-rest-client-reactive, and quarkus-rest-client-reactive-jackson

When the service called return an invalid body, for example an invalid json, and a success status code, rest-client will throw :

org.jboss.resteasy.reactive.ClientWebApplicationException: Received: 'HTTP 400 Bad Request' when invoking: Rest Client method: 'org.acme.Endpoint#getDumb'

But the request is fine, in fact, this is the response that is incorrect.

This issue misleads investigations when we want to troubleshoot a problem between the client and the service.

The project contained in badrequest-reproducer.zip reproduce the issue with MockServer.

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

badrequest-reproducer.zip

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.16.6-Final

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

quarkus-bot[bot] commented 1 year ago

/cc @Sgitario (rest-client), @cescoffier (rest-client), @geoand (rest-client)

geoand commented 1 year ago

I'll have a look

benDeMtp commented 1 year ago

I just tried with 3.0.0.CR2, the behavior is the same.

geoand commented 1 year ago

https://github.com/quarkusio/quarkus/pull/32715 fixes the issue

tanton81 commented 1 year ago

Hello, I am able to reproduce the issue with a well formed body but in the same time, it is not the client expects from the server. I have quarkus 3.2.5.Final or may be 3.2.6.Final