ruanwenjun commented on code in PR #18676:
URL:
https://github.com/apache/dolphinscheduler/pull/18676#discussion_r4217202212
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkflowDefinitionServiceImpl.java:
##########
@@ -979,7 +998,15 @@ public void checkWorkflowNodeList(String
workflowTaskRelationJson,
List<WorkflowTaskRelation> taskRelationList =
JSONUtils.toList(workflowTaskRelationJson,
WorkflowTaskRelation.class);
// Check whether the task node is normal
- List<TaskNode> taskNodes =
processService.transformTask(taskRelationList, taskDefinitionLogsList);
+ List<TaskNode> taskNodes;
+ try {
+ taskNodes = processService.transformTask(taskRelationList,
taskDefinitionLogsList);
+ } catch
(org.apache.dolphinscheduler.service.exceptions.ServiceException e) {
+ // transformTask reports task codes referenced by relations
but missing in task definitions
+ log.error("Task definitions do not exist, given
workflowTaskRelationJson: {}",
+ workflowTaskRelationJson, e);
Review Comment:
It's better to throw ServiceException at `transformTask` rather than wrap
all exception into `new ServiceException(Status.TASK_DEFINE_NOT_EXIST,
e.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]