fix: format error correctly (#4204)

* chore: remove TODO comments

* fix: format error correctly
This commit is contained in:
Weny Xu
2024-06-25 15:56:13 +08:00
committed by GitHub
parent a1e2612bbf
commit b2f61aa1cf
8 changed files with 19 additions and 40 deletions

View File

@@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use common_error::ext::ErrorExt;
use common_meta::instruction::{InstructionReply, SimpleReply};
use common_meta::RegionIdent;
use common_telemetry::{tracing, warn};
@@ -47,7 +46,7 @@ impl HandlerContext {
}
Err(err) => InstructionReply::CloseRegion(SimpleReply {
result: false,
error: Some(err.output_msg()),
error: Some(format!("{err:?}")),
}),
}
})

View File

@@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use common_error::ext::ErrorExt;
use common_meta::instruction::{DowngradeRegion, DowngradeRegionReply, InstructionReply};
use futures_util::future::BoxFuture;
use store_api::region_engine::SetReadonlyResponse;
@@ -43,7 +42,7 @@ impl HandlerContext {
Err(err) => InstructionReply::DowngradeRegion(DowngradeRegionReply {
last_entry_id: None,
exists: true,
error: Some(err.output_msg()),
error: Some(format!("{err:?}")),
}),
}
})

View File

@@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use common_error::ext::ErrorExt;
use common_meta::instruction::{InstructionReply, OpenRegion, SimpleReply};
use common_meta::wal_options_allocator::prepare_wal_options;
use futures_util::future::BoxFuture;
@@ -43,7 +42,7 @@ impl HandlerContext {
});
let result = self.region_server.handle_request(region_id, request).await;
let success = result.is_ok();
let error = result.as_ref().map_err(|e| e.output_msg()).err();
let error = result.as_ref().map_err(|e| format!("{e:?}")).err();
InstructionReply::OpenRegion(SimpleReply {
result: success,
error,

View File

@@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use common_error::ext::ErrorExt;
use common_meta::instruction::{InstructionReply, UpgradeRegion, UpgradeRegionReply};
use common_telemetry::{info, warn};
use futures_util::future::BoxFuture;
@@ -107,7 +106,7 @@ impl HandlerContext {
InstructionReply::UpgradeRegion(UpgradeRegionReply {
ready: false,
exists: true,
error: Some(err.output_msg()),
error: Some(format!("{err:?}")),
})
}
}