ChinmaySKulkarni commented on a change in pull request #676: PHOENIX-5636:
Improve the error message when client connects to server with higher major
version
URL: https://github.com/apache/phoenix/pull/676#discussion_r377863048
##########
File path:
phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
##########
@@ -1588,15 +1593,27 @@ public GetVersionResponse call(MetaDataService
instance)
}
}
}
- if (isIncompatible) {
- buf.setLength(buf.length()-1);
- throw new
SQLExceptionInfo.Builder(SQLExceptionCode.OUTDATED_JARS).setMessage(buf.toString()).build().buildException();
+ if (!(errorCode.toString().isEmpty())) {
+ if (Integer.parseInt(errorCode.toString()) ==
SQLExceptionCode.OUTDATED_JARS.getErrorCode()) {
+ errorMessage.setLength(errorMessage.length()-1);
+ throw new
SQLExceptionInfo.Builder(SQLExceptionCode.OUTDATED_JARS).setMessage(errorMessage.toString()).build().buildException();
+ } else {
+ throw new
SQLExceptionInfo.Builder(SQLExceptionCode.INCOMPATIBLE_CLIENT_SERVER_JAR).setMessage(errorMessage.toString()).build().buildException();
+ }
}
+
if (systemCatalogTimestamp < MIN_SYSTEM_TABLE_TIMESTAMP) {
throw new UpgradeRequiredException(systemCatalogTimestamp);
}
}
+ private String displayClientandServerVersions(long serverJarVersion) {
Review comment:
nit: Rename method to "getClientAndServerVersions" since we're not really
printing to stdout or logging the versions for it to be "display<xyz>".
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services