Copilot commented on code in PR #16240:
URL: https://github.com/apache/iotdb/pull/16240#discussion_r2292988676
##########
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/exception/IoTDBException.java:
##########
@@ -38,30 +38,38 @@ public class IoTDBException extends Exception {
public IoTDBException(String message, int errorCode) {
super(message);
this.errorCode = errorCode;
+ this.status = new TSStatus(errorCode);
+ this.status.setMessage(message);
this.isUserException = false;
}
public IoTDBException(String message, int errorCode, boolean
isUserException) {
super(message);
this.errorCode = errorCode;
+ this.status = new TSStatus(errorCode);
+ this.status.setMessage(message);
this.isUserException = isUserException;
}
public IoTDBException(String message, Throwable cause, int errorCode) {
super(message, cause);
this.errorCode = errorCode;
+ this.status = new TSStatus(errorCode);
+ this.status.setMessage(message);
this.isUserException = false;
}
public IoTDBException(Throwable cause, int errorCode) {
super(cause);
this.errorCode = errorCode;
+ this.status = new TSStatus(errorCode);
this.isUserException = false;
}
public IoTDBException(Throwable cause, int errorCode, boolean
isUserException) {
super(cause);
this.errorCode = errorCode;
+ this.status = new TSStatus(errorCode);
Review Comment:
The status object is created but the message is not set. Consider adding
`this.status.setMessage(cause.getMessage())` to maintain consistency with other
constructors that set the status message.
```suggestion
this.status = new TSStatus(errorCode);
this.status.setMessage(cause.getMessage());
```
##########
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/exception/IoTDBException.java:
##########
@@ -38,30 +38,38 @@ public class IoTDBException extends Exception {
public IoTDBException(String message, int errorCode) {
super(message);
this.errorCode = errorCode;
+ this.status = new TSStatus(errorCode);
+ this.status.setMessage(message);
this.isUserException = false;
}
public IoTDBException(String message, int errorCode, boolean
isUserException) {
super(message);
this.errorCode = errorCode;
+ this.status = new TSStatus(errorCode);
+ this.status.setMessage(message);
this.isUserException = isUserException;
}
public IoTDBException(String message, Throwable cause, int errorCode) {
super(message, cause);
this.errorCode = errorCode;
+ this.status = new TSStatus(errorCode);
+ this.status.setMessage(message);
this.isUserException = false;
}
public IoTDBException(Throwable cause, int errorCode) {
super(cause);
this.errorCode = errorCode;
+ this.status = new TSStatus(errorCode);
Review Comment:
The status object is created but the message is not set. Consider adding
`this.status.setMessage(cause.getMessage())` to maintain consistency with other
constructors that set the status message.
```suggestion
this.status = new TSStatus(errorCode);
this.status.setMessage(cause.getMessage());
```
--
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]