Skip to content

Commit

Permalink
Add missing logs in DynamicEndpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
SMadani committed Jan 9, 2025
1 parent b03d43d commit ab7f3a8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/com/vonage/client/DynamicEndpoint.java
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ else if (Collection.class.isAssignableFrom(responseType) || isJsonableArrayRespo
R customParsedResponse = parseResponseFromString(deser);
if (customParsedResponse == null) {
String errorMsg = "Unhandled return type: " + responseType;
logger.warning(errorMsg);
logger.severe(errorMsg);
throw new IllegalStateException(errorMsg);
}
else {
Expand All @@ -350,6 +350,7 @@ private R parseResponseFailure(HttpResponse response) throws IOException, Reflec
varex.title = response.getStatusLine().getReasonPhrase();
}
varex.statusCode = response.getStatusLine().getStatusCode();
logger.log(Level.WARNING, "Failed to parse response", varex);
throw varex;
}
else {
Expand All @@ -368,6 +369,7 @@ private R parseResponseFailure(HttpResponse response) throws IOException, Reflec
}
R customParsedResponse = parseResponseFromString(exMessage);
if (customParsedResponse == null) {
logger.warning(exMessage);
throw new VonageApiResponseException(exMessage);
}
else {
Expand Down

0 comments on commit ab7f3a8

Please sign in to comment.