pact-foundation / pact-jvm

JVM version of Pact. Enables consumer driven contract testing, providing a mock service and DSL for the consumer project, and interaction playback and verification for the service provider project.
https://docs.pact.io
Apache License 2.0
1.08k stars 479 forks source link

HalClient should include HTTP response body in exception message #1830

Open timvahlbrock opened 1 month ago

timvahlbrock commented 1 month ago

If the communication with the pact broker fails (in my case because I used the matching branch selector, but did not provide a provider branch name), the status code (in my case 400) is logged, but not the response body. Especially in 400 responses this would really simplify the debugging. Right now I have to set a breakpoint within pact to get the response body.

timvahlbrock commented 1 month ago

Nvm. just took a further look around where RequestFailedException is used. Seems that it should be parsed and logged in case of 400 errors. Will further investigate, why I'm not seeing it.

timvahlbrock commented 1 month ago

400 response is only logged when publishing, would be helpful with contract fetching as well.