fix(ecstore): classify peer RPC failures by gRPC status code (#5400)

This commit is contained in:
Zhengchao An
2026-07-29 11:35:09 +08:00
committed by GitHub
parent 2423ba8e3f
commit 90d1a15d13
5 changed files with 369 additions and 60 deletions
+5 -1
View File
@@ -818,7 +818,11 @@ impl From<s3s::xml::DeError> for Error {
impl From<tonic::Status> for Error {
fn from(e: tonic::Status) -> Self {
Error::other(e.to_string())
// Keep the typed status as the io::Error payload instead of a
// flattened string so RPC failure classifiers can read the gRPC code
// via downcast (see `PeerRestClient::is_network_like_error`).
// `RpcStatusError` renders exactly as `e.to_string()` did.
Error::other(crate::disk::error::RpcStatusError::from(e))
}
}