Page MenuHomePhabricator

D9478.diff
No OneTemporary

D9478.diff

diff --git a/shared/grpc_clients/src/error.rs b/shared/grpc_clients/src/error.rs
--- a/shared/grpc_clients/src/error.rs
+++ b/shared/grpc_clients/src/error.rs
@@ -1,4 +1,4 @@
-use tonic::{codegen::http::uri::InvalidUri, Status};
+use tonic::{codegen::http::uri::InvalidUri, Code, Status};
#[derive(
Debug, derive_more::Display, derive_more::From, derive_more::Error,
@@ -13,3 +13,12 @@
#[display(fmt = "Invalid Device Type")]
InvalidDeviceType,
}
+
+pub fn unsupported_version() -> Status {
+ Status::unimplemented("Unsupported version")
+}
+
+pub fn is_version_unsupported(status: Status) -> bool {
+ status.code() == Code::Unimplemented
+ && status.message() == "Unsupported version"
+}

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 22, 2:31 PM (17 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2553857
Default Alt Text
D9478.diff (708 B)

Event Timeline