veghlaci05 commented on code in PR #4214:
URL: https://github.com/apache/hive/pull/4214#discussion_r1163767143
##########
itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestActivePassiveHA.java:
##########
@@ -665,7 +666,18 @@ private String sendAuthMethod(HttpRequestBase method,
boolean enableAuth, boolea
httpResponse = client.execute(method);
- return EntityUtils.toString(httpResponse.getEntity());
+ if (httpResponse != null) {
+ StatusLine statusLine = httpResponse.getStatusLine();
+ if (statusLine != null) {
+ response = httpResponse.getStatusLine().getReasonPhrase();
+ statusCode = httpResponse.getStatusLine().getStatusCode();
+ if (statusCode == 200) {
+ return EntityUtils.toString(httpResponse.getEntity());
+ }
Review Comment:
Why this is needed only for HTTP 200? For any other response code this
function will return `response`, which is actually
`httpResponse.getStatusLine().getReasonPhrase()`. I don't get why this is
needed.
--
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]