Skip to content

Commit

Permalink
Update PipeStatementExceptionVisitor.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Caideyipi committed May 24, 2024
1 parent 339f9ac commit 6475b9b
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,12 @@ public TSStatus visitInternalCreateMultiTimeSeries(

private TSStatus visitGeneralCreateTimeSeries(
final Statement statement, final Exception context) {
if (context instanceof SemanticException || isAutoCreateConflict(context)) {
if (context instanceof SemanticException) {
return new TSStatus(TSStatusCode.PIPE_RECEIVER_USER_CONFLICT_EXCEPTION.getStatusCode())
.setMessage(context.getMessage());
} else if (isAutoCreateConflict(context)) {
return new TSStatus(TSStatusCode.PIPE_RECEIVER_USER_CONFLICT_EXCEPTION.getStatusCode())
.setMessage(context.getCause().getMessage());
}
return visitStatement(statement, context);
}
Expand All @@ -121,11 +124,12 @@ public TSStatus visitBatchActivateTemplate(

private TSStatus visitGeneralActivateTemplate(
final Statement activateTemplateStatement, final Exception context) {
if (context instanceof MetadataException
|| context instanceof StatementAnalyzeException
|| isAutoCreateConflict(context)) {
if (context instanceof MetadataException || context instanceof StatementAnalyzeException) {
return new TSStatus(TSStatusCode.PIPE_RECEIVER_USER_CONFLICT_EXCEPTION.getStatusCode())
.setMessage(context.getMessage());
} else if (isAutoCreateConflict(context)) {
return new TSStatus(TSStatusCode.PIPE_RECEIVER_USER_CONFLICT_EXCEPTION.getStatusCode())
.setMessage(context.getCause().getMessage());
}
return visitStatement(activateTemplateStatement, context);
}
Expand Down

0 comments on commit 6475b9b

Please sign in to comment.