You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2021/02/08 11:46:04 UTC

[GitHub] [incubator-dolphinscheduler] CalvinKirs commented on a change in pull request #4739: [Fix-4738][Mail] Fix send mail failed instead of execute sql error

CalvinKirs commented on a change in pull request #4739:
URL: https://github.com/apache/incubator-dolphinscheduler/pull/4739#discussion_r571983202



##########
File path: dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java
##########
@@ -298,8 +298,12 @@ private void resultProcess(ResultSet resultSet) throws Exception {
         String result = JSONUtils.toJsonString(resultJSONArray);
         logger.debug("execute sql : {}", result);
 
-        sendAttachment(sqlParameters.getGroupId(), StringUtils.isNotEmpty(sqlParameters.getTitle()) ? sqlParameters.getTitle() : taskExecutionContext.getTaskName() + " query result sets",
-                JSONUtils.toJsonString(resultJSONArray));
+        try {
+            sendAttachment(sqlParameters.getGroupId(), StringUtils.isNotEmpty(sqlParameters.getTitle()) ? sqlParameters.getTitle() : taskExecutionContext.getTaskName() + " query result sets",
+                    JSONUtils.toJsonString(resultJSONArray));
+        } catch (Exception e) {
+            logger.warn(e.getMessage());

Review comment:
       Suggest: logger.warn("sql task senAttachement error! msg : {} ",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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org