修改异常信息
continuous-integration/drone/push Build is passing Details

于相涌/robot_optimize
YXY 1 year ago
parent 0e2d9934c8
commit 0360269ec6

@ -21,6 +21,8 @@ public class LarkCalendarHelper extends LarkHelper {
LarkCalendarHelper calendarHelper = new LarkCalendarHelper(); LarkCalendarHelper calendarHelper = new LarkCalendarHelper();
LarkCalendarRequest calendarRequest = new LarkCalendarRequest(appId, secret); LarkCalendarRequest calendarRequest = new LarkCalendarRequest(appId, secret);
PrimaryCalendarRespBody primaryCalendar = calendarHelper.getPrimaryCalendar(calendarRequest); PrimaryCalendarRespBody primaryCalendar = calendarHelper.getPrimaryCalendar(calendarRequest);
String errorMessageBody = new LarkException("LarkCalendarHelper.getPrimaryCalendar", "errorInfo", calendarRequest).getErrorMessageBody();
log.info(errorMessageBody);
int i = 0; int i = 0;
} }

@ -24,9 +24,15 @@ public class LarkException {
this.request = request; this.request = request;
} }
public String getErrorMessageBody(){ public String getErrorMessageBody(){
return this.toString(); StringBuilder sb = new StringBuilder("\n");
sb.append("异常来源:").append(origin).append("\n");
sb.append("异常信息:").append(errorMessage).append("\n");
if (request instanceof LarkRequest){
LarkRequest req = (LarkRequest) this.request;
sb.append("appId:").append(req.getAppId()).append("\n");
}
sb.append("请求体:").append(request);
return sb.toString();
} }
} }

@ -128,13 +128,14 @@ public class ApprovalCallbackOperate extends LarkAbstract {
@Override @Override
protected void businessProcessing(RequestVo request) { protected void businessProcessing(RequestVo request) {
if (request.getTableRelationMap() == null || request.getTableRelationMap().isEmpty()){ Map<String, Long> tableRelationMap = request.getTableRelationMap();
if (tableRelationMap == null || tableRelationMap.isEmpty()){
return; return;
} }
if (request.getInstanceRespBody() == null) { if (request.getInstanceRespBody() == null) {
return; return;
} }
for (Map.Entry<String, Long> entry : request.getTableRelationMap().entrySet()) { for (Map.Entry<String, Long> entry : tableRelationMap.entrySet()) {
String[] arr = entry.getKey().split("_"); String[] arr = entry.getKey().split("_");
request.setToAppToken(arr[0]); request.setToAppToken(arr[0]);
request.setToTableId(arr[1]); request.setToTableId(arr[1]);

Loading…
Cancel
Save