Skip to content

Commit

Permalink
Show actual error response from UID2 operator instead of generic erro…
Browse files Browse the repository at this point in the history
…r response from Java network library
  • Loading branch information
sunnywu committed Dec 7, 2023
1 parent c8157c5 commit 25313c1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/com/uid2/client/PublisherUid2Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ public TokenGenerateResponse generateTokenResponse(TokenGenerateInput tokenGener

private static String getResponse(Response response) {
try {
return response.body() != null ? response.body().string() : "";
if(response == null) {
return "empty response";
}
return response.body() != null ? response.body().string() : response.toString();
} catch (IOException e) {
throw new Uid2Exception("Error communicating with api endpoint", e);
}
Expand Down

0 comments on commit 25313c1

Please sign in to comment.