jackjlli commented on a change in pull request #7812:
URL: https://github.com/apache/pinot/pull/7812#discussion_r754721903
##########
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:
I understand that we didn't change the properties in this PR. The
concern I have here is that client code and server code may not run the same
version. Since the error message can come from either `error` or `_error`,
should we consider the backward compatibility here, like trying to fetch both
fields?
One scenario I can think of is that if the response still shows `_error` in
the payload, when the `stringToObject()` method in Line 547 gets invoked, it
will still fail because no `_error` is specified as a JsonProperty. In this
case, we still cannot parse the payload correctly.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]