JNSimba commented on code in PR #309:
URL:
https://github.com/apache/doris-spark-connector/pull/309#discussion_r2048618422
##########
spark-doris-connector/spark-doris-connector-base/src/main/java/org/apache/doris/spark/client/DorisFrontendClient.java:
##########
@@ -114,7 +115,13 @@ private List<Frontend> initFrontends(DorisConfig config)
throws Exception {
+ ", reason: " +
response.getStatusLine().getReasonPhrase());
}
String entity =
EntityUtils.toString(response.getEntity());
- dataNode = extractEntity(entity, "data");
+ LOG.info("get response:
{} with fe request url: {}", entity, feReqURL);
+ JsonNode respNode = MAPPER.readTree(entity);
+ String code = respNode.get("code").asText();
+ if(!"0".equalsIgnoreCase(code)) {
+ throw new RuntimeException("fetch fe request
with invalid code, response: " + entity);
+ }
+ dataNode = respNode.get("data");
Review Comment:
Yes, you are right , it is indeed necessary to throw here, especially when
the executor log cannot be viewed.
Maybe we also need to consider other http calls? Maybe there is a general
way to handle it, such as throwing entityString directly when an error occurs
--
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]