update - 完善钉钉报错逻辑

This commit is contained in:
wangli 2024-02-21 20:00:27 +08:00
parent 845ec1fd1f
commit 6934309883

View File

@ -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);
}