Skip to content

Commit

Permalink
fix: fix non-physical error msg (#3087)
Browse files Browse the repository at this point in the history
  • Loading branch information
WenyXu authored Jan 3, 2024
1 parent aa22f9c commit b2b7523
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/common/meta/src/key/table_route.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
Expand All @@ -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
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion src/meta-srv/src/procedure/region_migration/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 })?;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/partition/src/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
}
Expand All @@ -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!(
Expand Down

0 comments on commit b2b7523

Please sign in to comment.