Skip to content

Commit

Permalink
fetchSlackLinks log response body in IT
Browse files Browse the repository at this point in the history
  • Loading branch information
Yevhen Hrytsai committed Apr 16, 2024
1 parent 1b61604 commit 2e27a7b
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,15 @@ public SlackLinkClient slackLink() {

public class SlackLinkClient {
public GetWorkspacesResponse fetchSlackLinks() {
try (Response response = get(withRestUrl("connection").build())) {
return gson.fromJson(response.body().string(), GetWorkspacesResponse.class);
Response response = get(withRestUrl("connection").build());
String body = "";
try {
body = response.body().string();
return gson.fromJson(body, GetWorkspacesResponse.class);
} catch (Exception e) {
throw new RuntimeException(e);
throw new RuntimeException("Response body: " + body, e);
} finally {
response.close();
}
}

Expand Down

0 comments on commit 2e27a7b

Please sign in to comment.