You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2021/11/22 23:50:23 UTC

[GitHub] [pinot] sajjad-moradi commented on a change in pull request #7812: Fix and refactor error handling on Controller endpoints

sajjad-moradi commented on a change in pull request #7812:
URL: https://github.com/apache/pinot/pull/7812#discussion_r754717741



##########
File path: pinot-common/src/main/java/org/apache/pinot/common/utils/FileUploadDownloadClient.java
##########
@@ -543,9 +543,10 @@ private static String getErrorMessage(HttpUriRequest request, CloseableHttpRespo
     StatusLine statusLine = response.getStatusLine();
     String reason;
     try {
-      reason = JsonUtils.stringToJsonNode(EntityUtils.toString(response.getEntity())).get("_error").asText();
+      String entityStr = EntityUtils.toString(response.getEntity());
+      reason = JsonUtils.stringToObject(entityStr, SimpleHttpErrorInfo.class).getError();

Review comment:
       The incompatibility issue you're referring to comes into picture when/if the object definition is changed. This PR only refactors the way the POJO is deserialized. It does not change the properties of object itself. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org