You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "VGalaxies (via GitHub)" <gi...@apache.org> on 2025/08/22 07:41:36 UTC
[PR] Fix: Initialize status field in IoTDBException ctors [iotdb]
VGalaxies opened a new pull request, #16240:
URL: https://github.com/apache/iotdb/pull/16240
fixup #16091
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix uninitialized status field in IoTDBException ctors [iotdb]
Posted by "VGalaxies (via GitHub)" <gi...@apache.org>.
VGalaxies closed pull request #16240: Fix uninitialized status field in IoTDBException ctors
URL: https://github.com/apache/iotdb/pull/16240
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix uninitialized status field in IoTDBException ctors [iotdb]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org