deniskuzZ commented on code in PR #5520:
URL: https://github.com/apache/hive/pull/5520#discussion_r1826563864
##########
service/src/java/org/apache/hive/service/cli/HiveSQLException.java:
##########
@@ -150,4 +185,11 @@ public static TStatus toTStatus(Exception e) {
return tStatus;
}
+ private static String getErrorMsg(String message, String queryId) {
Review Comment:
i think it could be done simpler, just override the Throwable#getMessage and
set queryId in class property in constructor
````
@Override
String getMessage(){
String errorMsg = super.getMessage();
if (!errorMsg.contains(ServiceContext.QUERY_ID)) {
return String.format("%1$s; %2$s: %3$s", errorMsg,
ServiceContext.QUERY_ID, queryId);
} else {
return errorMsg;
}
}
````
##########
service/src/java/org/apache/hive/service/cli/HiveSQLException.java:
##########
@@ -150,4 +185,11 @@ public static TStatus toTStatus(Exception e) {
return tStatus;
}
+ private static String getErrorMsg(String message, String queryId) {
Review Comment:
i think it could be done simpler, just override the Throwable#getMessage and
set queryId in class property in constructor
````
@Override
String getMessage(){
String errorMsg = super.getMessage();
if (!errorMsg.contains(ServiceContext.QUERY_ID)) {
return String.format("%1$s; %2$s: %3$s", errorMsg,
ServiceContext.QUERY_ID, queryId);
} else {
return errorMsg;
}
}
````
--
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]