[Fix-4738][Mail] Fix send mail failed instead of execute sql error (#4739)

This commit is contained in:
Shiwen Cheng 2021-02-11 09:54:07 +08:00 committed by GitHub
parent c9972936d6
commit 0c26e10f3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -298,8 +298,12 @@ public class SqlTask extends AbstractTask {
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("sql task sendAttachment error! msg : {} ", e.getMessage());
}
}
/**