文章目录
统一异常处理实现
`
import com.msb.dongbao.common.base.result.ResultWrapper;
import org.springframework.web.bind.annotation.*;
@RestControllerAdvice
public class GlobalExceptionHandle {
//具体处理得异常
@ExceptionHandler(Exception.class)
public ResultWrapper customException(){
return ResultWrapper.builder().code(301).msg("统一异常").build();
}
}