yangyichao-mango commented on a change in pull request #3514:
URL: 
https://github.com/apache/incubator-dolphinscheduler/pull/3514#discussion_r471057537



##########
File path: 
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ResourcesService.java
##########
@@ -1232,4 +1218,16 @@ void listAllChildren(int resourceId,List<Integer> 
childList){
         }
     }
 
+    /**
+     * save resource and  check save status
+     * @param resource resource
+     */
+    private void saveResource(Resource resource){
+        int saveResourceStatus = resourcesMapper.insert(resource);
+        if (saveResourceStatus != 1) {
+            logger.error("resource  maybe already exists, can't recreate ");
+            throw new DDLException("resource maybe already exists, can't 
recreate");

Review comment:
       Hi,
   Is it better to use `ServiceException`, because I do not find the difference 
except name about `ServiceException` and `DDLException`, and I think this logic 
actually is service and business exception not ddl exception (ddl exception 
means the ddl statement process has exception).




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to