|
|
@@ -41,27 +41,24 @@ public class FeignProviderExceptionHandler {
|
|
|
if(e instanceof BusinessException) {
|
|
|
BusinessException error = (BusinessException)e;
|
|
|
log.warn(e.getMessage());
|
|
|
- return rendError(true,new BaseCode(error.getCode(),error.getMsg()),e);
|
|
|
- }
|
|
|
- if(e instanceof FeignProviderException) {
|
|
|
- return e;
|
|
|
+ return rendError(true,new BaseCode(error.getCode(),error.getMsg()));
|
|
|
}
|
|
|
else if(e instanceof MethodArgumentNotValidException) {
|
|
|
MethodArgumentNotValidException error = (MethodArgumentNotValidException)e;
|
|
|
BindingResult result = error.getBindingResult();
|
|
|
log.warn("请求参数错误:{}",result.getFieldError().getDefaultMessage());
|
|
|
- return rendError(true,BaseCode.ERR_PARAMS_VALID,e);
|
|
|
+ return rendError(true,BaseCode.ERR_PARAMS_VALID);
|
|
|
}
|
|
|
else if(e instanceof MissingServletRequestParameterException) {
|
|
|
log.warn("请求缺少参数:{}",e.getMessage());
|
|
|
- return rendError(true,BaseCode.ERR_PARAMS_MISS,e);
|
|
|
+ return rendError(true,BaseCode.ERR_PARAMS_MISS);
|
|
|
}
|
|
|
log.error("系统错误:{}",e.getMessage(), e);
|
|
|
- return rendError(false,BaseCode.ERROR,e);
|
|
|
+ return rendError(false,BaseCode.ERROR);
|
|
|
}
|
|
|
|
|
|
- public Object rendError(boolean isBusinessException,BaseCode code, Throwable cause) {
|
|
|
- FeignProviderException exception = new FeignProviderException(isBusinessException,serviceName,code,cause);
|
|
|
+ public Object rendError(boolean isBusinessException,BaseCode code) {
|
|
|
+ FeignProviderException exception = new FeignProviderException(isBusinessException,serviceName,code);
|
|
|
return exception;
|
|
|
}
|
|
|
|