Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3340138
D9478.id32166.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
708 B
Referenced Files
None
Subscribers
None
D9478.id32166.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 22, 9:26 PM (18 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2553857
Default Alt Text
D9478.id32166.diff (708 B)
Attached To
Mode
D9478: [shared] helper functions to get/set version unsupported status
Attached
Detach File
Event Timeline
Log In to Comment