下面展示一些 内联代码片
。
/**
* 异常处理拦截器
* @author ex_lifc
*
*/
@ControllerAdvice
@ResponseBody
public class GlobalExceptionHandler {
@ExceptionHandler(value = Exception.class)
public <T> ReturnDto<T> exceptionHandler(HttpServletRequest request, Exception e) throws FeignException {
String msg = e.getMessage();
ReturnDto<T> returnDto = new ReturnDto<>();
returnDto.setStatus(100);
returnDto.setMsg(msg);
return returnDto;
}
}