Skip to content

Commit 2ff9552

Browse files
committed
polish
1 parent 5383a48 commit 2ff9552

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

client/src/main/java/io/split/service/SplitHttpClientImpl.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,16 @@ public SplitHttpResponse get(URI uri, FetchOptions options, Map<String, List<Str
8888

8989
String statusMessage = "";
9090
int code = response.getCode();
91-
String body = "";
9291
if (code < HttpStatus.SC_OK || code >= HttpStatus.SC_MULTIPLE_CHOICES) {
9392
statusMessage = response.getReasonPhrase();
9493
_log.warn(String.format("Response status was: %s. Reason: %s", code, statusMessage));
95-
} else {
94+
}
95+
96+
String body = "";
97+
try {
9698
body = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8);
99+
} catch (Exception e) {
100+
_log.warn(String.format("Error parsing Response.body, %s", e.getMessage()));
97101
}
98102

99103
return new SplitHttpResponse(code,

0 commit comments

Comments
 (0)