全局异常处理方案:
@ControllerAdvice
@ResponseBody
public class GlobalExceptionHandler {
private final Logger logger = LoggerFactory.getLogger(GlobalExceptionHandler.class);
@ExceptionHandler(value = Exception.class)
public xxx defaultErrorHandler(Exception e){
logger.error(e.getMessage(),e);
return xxx;
}
}