chengshiwen commented on a change in pull request #4739:
URL:
https://github.com/apache/incubator-dolphinscheduler/pull/4739#discussion_r572612963
##########
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) {
Review comment:
As a user, he just want to execute a sql like `update table set`. But
because the mail configuration is not set, the `execute sql error` occurs and
the task gets failed while sql has been updated. The reason for the error is
just `send mail failed`.
So it's weird about this. It would be a more reasonable way to give a
warning about the `send mail failed` 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]