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;
88impl ClientHandler for MyClientHandler {
99 async fn handle_process_error (
1010 & self ,
11- _error_message : String ,
12- _ : & dyn McpClient ,
11+ error_message : String ,
12+ runtime : & dyn McpClient ,
1313 ) -> std:: result:: Result < ( ) , RpcError > {
14+ if !runtime. is_shut_down ( ) . await {
15+ eprintln ! ( "{}" , error_message) ;
16+ }
1417 Ok ( ( ) )
1518 }
1619}
Original file line number Diff line number Diff line change @@ -432,12 +432,16 @@ impl McpDiscovery {
432432 return Ok ( None ) ;
433433 }
434434
435- let resource_templates : Vec < ResourceTemplate > = client
435+ let result = client
436436 . 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+ }
441445 }
442446
443447 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(
9292
9393 let cwd = std:: env:: current_dir ( ) ?;
9494 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))
9895}
9996
10097pub fn find_template_file (
You can’t perform that action at this time.
0 commit comments