Commit dfa486b
committed
Fix missing response body in client exceptions
As of gh-1117, the `HttpSyncGraphQlClient` supports the "GraphQL over
HTTP" specification. More specifically, it now handles HTTP 4xx
responses sent by GraphQL servers when the response content type is
"applcation/graphql-response+json".
This change introduced a regression where 4xx and 5xx HTTP responses now
always throw `HttpClientErrorException` (instead of throwing
`HttpClientErrorException` or `HttpServerErrorException` depending on
the case), and this exception is missing the response body and other
information from the response.
This commit ensures that exceptions are thrown in a similar fashion to
the default `StatusHandler` from Framwork.
Fixes gh-12591 parent d01b55d commit dfa486b
File tree
2 files changed
+211
-136
lines changed- spring-graphql/src
- main/java/org/springframework/graphql/client
- test/java/org/springframework/graphql/client
2 files changed
+211
-136
lines changedLines changed: 33 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| 29 | + | |
| 30 | + | |
27 | 31 | | |
28 | 32 | | |
29 | 33 | | |
| 34 | + | |
30 | 35 | | |
| 36 | + | |
31 | 37 | | |
| 38 | + | |
32 | 39 | | |
33 | 40 | | |
34 | 41 | | |
| |||
75 | 82 | | |
76 | 83 | | |
77 | 84 | | |
78 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
79 | 95 | | |
80 | 96 | | |
81 | 97 | | |
| |||
85 | 101 | | |
86 | 102 | | |
87 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
88 | 120 | | |
0 commit comments