mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
禅道bug#1599修复
This commit is contained in:
+9
-2
@@ -3,6 +3,8 @@ package com.cf.imes.framework.web.core.handler;
|
||||
import cn.hutool.core.exceptions.ExceptionUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.cf.imes.framework.common.exception.ErrorData;
|
||||
import com.cf.imes.framework.common.exception.ServiceException;
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.common.util.monitor.TracerUtils;
|
||||
@@ -238,12 +240,17 @@ public class GlobalExceptionHandler {
|
||||
@ExceptionHandler(value = ServiceException.class)
|
||||
public CommonResult serviceExceptionHandler(ServiceException ex) {
|
||||
// 系统异常输出堆栈
|
||||
if(INTERNAL_SERVER_ERROR.getCode().equals(ex.getCode())) {
|
||||
if (INTERNAL_SERVER_ERROR.getCode().equals(ex.getCode())) {
|
||||
log.error("[serviceExceptionHandler]", ex);
|
||||
} else {
|
||||
log.error(String.format("==========[serviceExceptionHandler]==========,%s:%s", ex.getCode(), ex.getMessage()));
|
||||
}
|
||||
return CommonResult.error(ex.getCode(), ex.getMessage(), ex.getArgs());
|
||||
CommonResult<Object> error = CommonResult.error(ex.getCode(), ex.getMessage(), ex.getArgs());
|
||||
ErrorData errorData = ex.getErrorData();
|
||||
if (ObjectUtil.isNotNull(errorData)) {
|
||||
error.setData(errorData.getErrorData());
|
||||
}
|
||||
return error;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user