36 lines
1.2 KiB
Diff
36 lines
1.2 KiB
Diff
|
|
From adb73fcebd1d7698a2fffdb791c2e9d08e949d9c Mon Sep 17 00:00:00 2001
|
||
|
|
From: Yuhang Wei <weiyuhang3@huawei.com>
|
||
|
|
Date: Wed, 17 Jan 2024 14:39:34 +0800
|
||
|
|
Subject: [PATCH 05/13] refactor(rust os-agent): fix code check
|
||
|
|
|
||
|
|
Signed-off-by: Yuhang Wei <weiyuhang3@huawei.com>
|
||
|
|
---
|
||
|
|
KubeOS-Rust/cli/src/method/request.rs | 9 ++++-----
|
||
|
|
1 file changed, 4 insertions(+), 5 deletions(-)
|
||
|
|
|
||
|
|
diff --git a/KubeOS-Rust/cli/src/method/request.rs b/KubeOS-Rust/cli/src/method/request.rs
|
||
|
|
index 2dc1ffb..b4a24aa 100644
|
||
|
|
--- a/KubeOS-Rust/cli/src/method/request.rs
|
||
|
|
+++ b/KubeOS-Rust/cli/src/method/request.rs
|
||
|
|
@@ -36,13 +36,12 @@ pub fn parse_error(error: Error) -> anyhow::Error {
|
||
|
|
debug!("Json parse error: {:?}", e);
|
||
|
|
anyhow!("Failed to parse response")
|
||
|
|
},
|
||
|
|
- Error::Rpc(ref e) => match e.message == "Method not found" {
|
||
|
|
- true => {
|
||
|
|
+ Error::Rpc(ref e) => {
|
||
|
|
+ if e.message == "Method not found" {
|
||
|
|
anyhow!("Method is unimplemented")
|
||
|
|
- },
|
||
|
|
- false => {
|
||
|
|
+ } else {
|
||
|
|
anyhow!("{}", e.message)
|
||
|
|
- },
|
||
|
|
+ }
|
||
|
|
},
|
||
|
|
_ => {
|
||
|
|
debug!("{:?}", error);
|
||
|
|
--
|
||
|
|
2.34.1
|
||
|
|
|