引用块内容
/**
* spring boot 捕获异常-----捕获全局异常信息,统一返回给前台的数据格式
* Created by yangchen on 2018/2/7
*/
@ControllerAdvice
public class ExceptionHandler {
@org.springframework.web.bind.annotation.ExceptionHandler(value = Exception.class)
@ResponseBody
public Object handler(Exception e){
return ResultUtils.build(500,e.getMessage());
}
}