shahrs87 commented on a change in pull request #919:
URL: https://github.com/apache/phoenix/pull/919#discussion_r505632721
##########
File path:
phoenix-core/src/main/java/org/apache/phoenix/exception/SQLExceptionCode.java
##########
@@ -453,8 +453,13 @@ public SQLException newException(SQLExceptionInfo info) {
OPERATION_TIMED_OUT(6000, "TIM01", "Operation timed out.", new Factory() {
@Override
public SQLException newException(SQLExceptionInfo info) {
- return new SQLTimeoutException(OPERATION_TIMED_OUT.getMessage(),
- OPERATION_TIMED_OUT.getSQLState(),
OPERATION_TIMED_OUT.getErrorCode());
+ final String reason =
+ (info.getMessage() != null ? info.getMessage() : "")
+ + (info.getRootCause() != null ? " , rootCause: "
+ + info.getRootCause() : "");
+ return new SQLTimeoutException(reason,
Review comment:
Sorry missed this in my previous review.
If there is root cause exception present, you should use this constructor to
create SQLtimeoutException
```
public SQLTimeoutException(String reason,
String SQLState,
int vendorCode,
Throwable cause)
```
----------------------------------------------------------------
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]