Skip to content

Commit 52290a8

Browse files
committed
fix
1 parent 3fe2ff1 commit 52290a8

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/ErrorHandlingUtils.java‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,13 @@ private static TSStatus tryCatchQueryException(Exception e) {
196196
return RpcUtils.getStatus(
197197
((IoTDBException) t.getCause()).getErrorCode(), rootCause.getMessage());
198198
}
199+
// A SemanticException is reported as SEMANTIC_ERROR whatever code it carries, except
200+
// TABLE_IN_PRE_DELETE, which the client needs in order to tell a table that is being deleted
201+
// from an ordinary semantic error.
202+
if (((SemanticException) t).getErrorCode()
203+
== TSStatusCode.TABLE_IN_PRE_DELETE.getStatusCode()) {
204+
return RpcUtils.getStatus(TSStatusCode.TABLE_IN_PRE_DELETE, rootCause.getMessage());
205+
}
199206
return RpcUtils.getStatus(TSStatusCode.SEMANTIC_ERROR, rootCause.getMessage());
200207
} else if (t instanceof IoTDBRuntimeException) {
201208
return Objects.nonNull(((IoTDBRuntimeException) t).getStatus())

0 commit comments

Comments
 (0)