diff --git a/workflow-engine-server/src/main/java/cn/axzo/workflow/server/common/util/DingTalkUtils.java b/workflow-engine-server/src/main/java/cn/axzo/workflow/server/common/util/DingTalkUtils.java index 5ac55a5fc..e226865ed 100644 --- a/workflow-engine-server/src/main/java/cn/axzo/workflow/server/common/util/DingTalkUtils.java +++ b/workflow-engine-server/src/main/java/cn/axzo/workflow/server/common/util/DingTalkUtils.java @@ -7,6 +7,8 @@ import com.dingtalk.api.request.OapiRobotSendRequest; import com.dingtalk.api.response.OapiRobotSendResponse; import lombok.SneakyThrows; +import java.util.Objects; + /** * 钉钉告警处理 * @@ -28,7 +30,8 @@ public class DingTalkUtils { markdown.setTitle("Notice 流程实例创建失败, Env: " + profile); markdown.setText("#### [" + profile + "]流程实例创建失败\n" + "> 创建参数: " + JSON.toJSONString(req) + "\n\n" + - "> ###### 异常信息: " + JSON.toJSONString(throwable.getCause().getMessage()) + " \n"); + "> ###### 异常信息: " + JSON.toJSONString(Objects.isNull(throwable.getCause()) ? throwable.getMessage() : + throwable.getCause().getMessage()) + " \n"); request.setMarkdown(markdown); OapiRobotSendResponse response = client.execute(request); }