fix: fix non-physical error msg (#3087)

This commit is contained in:
Weny Xu
2024-01-03 18:40:03 +09:00
committed by GitHub
parent aa22f9c94a
commit b2b752337b
6 changed files with 11 additions and 11 deletions

View File

@@ -66,7 +66,7 @@ impl TableRouteValue {
ensure!(
self.is_physical(),
UnexpectedLogicalRouteTableSnafu {
err_msg: "{self:?} is a non-physical TableRouteValue.",
err_msg: format!("{self:?} is a non-physical TableRouteValue."),
}
);
let version = self.physical_table_route().version;
@@ -84,7 +84,7 @@ impl TableRouteValue {
ensure!(
self.is_physical(),
UnexpectedLogicalRouteTableSnafu {
err_msg: "{self:?} is a non-physical TableRouteValue.",
err_msg: format!("{self:?} is a non-physical TableRouteValue."),
}
);
Ok(self.physical_table_route().version)
@@ -95,7 +95,7 @@ impl TableRouteValue {
ensure!(
self.is_physical(),
UnexpectedLogicalRouteTableSnafu {
err_msg: "{self:?} is a non-physical TableRouteValue.",
err_msg: format!("{self:?} is a non-physical TableRouteValue."),
}
);
Ok(self
@@ -116,7 +116,7 @@ impl TableRouteValue {
ensure!(
self.is_physical(),
UnexpectedLogicalRouteTableSnafu {
err_msg: "{self:?} is a non-physical TableRouteValue.",
err_msg: format!("{self:?} is a non-physical TableRouteValue."),
}
);
Ok(&self.physical_table_route().region_routes)

View File

@@ -89,7 +89,7 @@ impl UpdateRegionMetadata {
let mut new_region_routes = table_route_value
.region_routes()
.context(error::UnexpectedLogicalRouteTableSnafu {
err_msg: "{self:?} is a non-physical TableRouteValue.",
err_msg: format!("{self:?} is a non-physical TableRouteValue."),
})?
.clone();

View File

@@ -256,7 +256,7 @@ impl RegionMigrationManager {
let region_route = table_route
.region_route(region_id)
.context(error::UnexpectedLogicalRouteTableSnafu {
err_msg: "{self:?} is a non-physical TableRouteValue.",
err_msg: format!("{table_route:?} is a non-physical TableRouteValue."),
})?
.context(error::RegionRouteNotFoundSnafu { region_id })?;

View File

@@ -86,7 +86,7 @@ impl RegionMigrationStart {
let region_route = table_route
.region_routes()
.context(error::UnexpectedLogicalRouteTableSnafu {
err_msg: "{self:?} is a non-physical TableRouteValue.",
err_msg: format!("{self:?} is a non-physical TableRouteValue."),
})?
.iter()
.find(|route| route.region.id == region_id)

View File

@@ -33,7 +33,7 @@ impl UpdateMetadata {
let mut region_routes = table_route_value
.region_routes()
.context(error::UnexpectedLogicalRouteTableSnafu {
err_msg: "{self:?} is a non-physical TableRouteValue.",
err_msg: format!("{self:?} is a non-physical TableRouteValue."),
})?
.clone();
let region_route = region_routes
@@ -86,7 +86,7 @@ impl UpdateMetadata {
let region_routes = table_route_value
.region_routes()
.context(error::UnexpectedLogicalRouteTableSnafu {
err_msg: "{self:?} is a non-physical TableRouteValue.",
err_msg: format!("{self:?} is a non-physical TableRouteValue."),
})?
.clone();
let region_route = region_routes

View File

@@ -79,7 +79,7 @@ impl PartitionRuleManager {
route
.region_routes()
.context(error::UnexpectedLogicalRouteTableSnafu {
err_msg: "{self:?} is a non-physical TableRouteValue.",
err_msg: format!("{route:?} is a non-physical TableRouteValue."),
})?;
Ok(RegionRoutes(region_routes.clone()))
}
@@ -96,7 +96,7 @@ impl PartitionRuleManager {
route
.region_routes()
.context(error::UnexpectedLogicalRouteTableSnafu {
err_msg: "{self:?} is a non-physical TableRouteValue.",
err_msg: format!("{route:?} is a non-physical TableRouteValue."),
})?;
ensure!(