File tree Expand file tree Collapse file tree 3 files changed +14
-10
lines changed Expand file tree Collapse file tree 3 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -8,9 +8,12 @@ pub struct MyClientHandler;
8
8
impl ClientHandler for MyClientHandler {
9
9
async fn handle_process_error (
10
10
& self ,
11
- _error_message : String ,
12
- _ : & dyn McpClient ,
11
+ error_message : String ,
12
+ runtime : & dyn McpClient ,
13
13
) -> std:: result:: Result < ( ) , RpcError > {
14
+ if !runtime. is_shut_down ( ) . await {
15
+ eprintln ! ( "{}" , error_message) ;
16
+ }
14
17
Ok ( ( ) )
15
18
}
16
19
}
Original file line number Diff line number Diff line change @@ -432,12 +432,16 @@ impl McpDiscovery {
432
432
return Ok ( None ) ;
433
433
}
434
434
435
- let resource_templates : Vec < ResourceTemplate > = client
435
+ let result = client
436
436
. list_resource_templates ( Some ( ListResourceTemplatesRequestParams :: default ( ) ) )
437
- . await ?
438
- . resource_templates ;
439
-
440
- Ok ( Some ( resource_templates) )
437
+ . await ;
438
+ match result {
439
+ Ok ( data) => Ok ( Some ( data. resource_templates ) ) ,
440
+ Err ( err) => {
441
+ eprintln ! ( "Unable to retrieve resource templates : {}" , err) ;
442
+ Ok ( None )
443
+ }
444
+ }
441
445
}
442
446
443
447
pub async fn discover ( & mut self ) -> DiscoveryResult < & McpServerInfo > {
Original file line number Diff line number Diff line change @@ -92,9 +92,6 @@ pub fn get_absolute_from_relative(
92
92
93
93
let cwd = std:: env:: current_dir ( ) ?;
94
94
Ok ( cwd. join ( joined_path) . clean ( ) )
95
-
96
- // Convert to absolute path (resolving symlinks and normalizing)
97
- // Ok(fs::canonicalize(&joined_path).unwrap_or_else(|_| joined_path))
98
95
}
99
96
100
97
pub fn find_template_file (
You can’t perform that action at this time.
0 commit comments