|
10 | 10 | import org.springframework.http.HttpMethod;
|
11 | 11 | import org.springframework.http.MediaType;
|
12 | 12 | import org.springframework.http.ResponseEntity;
|
13 |
| -import org.springframework.web.client.HttpClientErrorException; |
14 | 13 | import org.springframework.web.client.RestOperations;
|
15 | 14 |
|
16 | 15 | import java.net.URI;
|
@@ -62,14 +61,9 @@ protected String postForJson(Config config, String json, String path, Object...
|
62 | 61 | LOGGER.debug("{} request body: {}", buildUrl(config, path, params), json);
|
63 | 62 | String responseJson;
|
64 | 63 |
|
65 |
| - try { |
66 |
| - ResponseEntity<String> responseEntity = exchange(config, buildUrl(config, path, params), HttpMethod.POST, json, headers); |
67 |
| - responseJson = responseEntity.getBody(); |
68 |
| - LOGGER.debug("{} response body with HTTP CODE {}: {}", buildUrl(config, path, params), responseEntity.getStatusCode(), responseJson); |
69 |
| - } catch(HttpClientErrorException e) { |
70 |
| - LOGGER.debug("{} {} {}", buildUrl(config, path, params), e.getMessage(), e.getResponseBodyAsString()); |
71 |
| - throw new HttpClientErrorException(e.getStatusCode(), e.getStatusText(), e.getResponseBodyAsByteArray(), null); |
72 |
| - } |
| 64 | + ResponseEntity<String> responseEntity = exchange(config, buildUrl(config, path, params), HttpMethod.POST, json, headers); |
| 65 | + responseJson = responseEntity.getBody(); |
| 66 | + LOGGER.debug("{} response body with HTTP CODE {}: {}", buildUrl(config, path, params), responseEntity.getStatusCode(), responseJson); |
73 | 67 |
|
74 | 68 | return responseJson;
|
75 | 69 | }
|
|
0 commit comments