@Slf4j
@RestControllerAdvice
public class ExceptionControllerAdvice {
@ExceptionHandler
public R handlerServiceException(ServiceException e){
log.error("业务异常:{}",e);
return R.failed(e);
}
@ExceptionHandler
public R handlerServiceException(Exception e){
log.error("其他异常:{}",e);
return R.failed(e);
}
}
统一异常处理
最新推荐文章于 2024-08-20 10:27:21 发布