File tree Expand file tree Collapse file tree 3 files changed +21
-6
lines changed Expand file tree Collapse file tree 3 files changed +21
-6
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ deep-link : patch
3+ deep-link-js : patch
4+ ---
5+
6+ Revert the breaking change introduced by [ #2928 ] ( https://github.com/tauri-apps/plugins-workspace/pull/2928 ) .
Original file line number Diff line number Diff line change @@ -23,14 +23,21 @@ pub enum Error {
2323 #[ cfg( target_os = "linux" ) ]
2424 #[ error( transparent) ]
2525 ParseIni ( #[ from] ini:: ParseError ) ,
26- #[ cfg( target_os = "linux" ) ]
27- #[ error( "Failed to run OS command `{0}`: {1}" ) ]
28- Execute ( & ' static str , #[ source] std:: io:: Error ) ,
2926 #[ cfg( mobile) ]
3027 #[ error( transparent) ]
3128 PluginInvoke ( #[ from] tauri:: plugin:: mobile:: PluginInvokeError ) ,
3229}
3330
31+ // TODO(v3): change this into an error in v3,
32+ // see <https://github.com/tauri-apps/plugins-workspace/pull/2970#issuecomment-3244660138>.
33+ #[ inline]
34+ #[ cfg( target_os = "linux" ) ]
35+ pub ( crate ) fn inspect_command_error < ' a > ( command : & ' a str ) -> impl Fn ( & std:: io:: Error ) + ' a {
36+ move |e| {
37+ tracing:: error!( "Failed to run OS command `{command}`: {e}" ) ;
38+ }
39+ }
40+
3441impl Serialize for Error {
3542 fn serialize < S > ( & self , serializer : S ) -> std:: result:: Result < S :: Ok , S :: Error >
3643 where
Original file line number Diff line number Diff line change @@ -334,12 +334,14 @@ mod imp {
334334 Command :: new ( "update-desktop-database" )
335335 . arg ( target)
336336 . status ( )
337- . map_err ( |error| crate :: Error :: Execute ( "update-desktop-database" , error) ) ?;
337+ . inspect_err ( crate :: error:: inspect_command_error (
338+ "update-desktop-database" ,
339+ ) ) ?;
338340
339341 Command :: new ( "xdg-mime" )
340342 . args ( [ "default" , & file_name, mime_type. as_str ( ) ] )
341343 . status ( )
342- . map_err ( |error| crate :: Error :: Execute ( "xdg-mime" , error ) ) ?;
344+ . inspect_err ( crate :: error :: inspect_command_error ( "xdg-mime" ) ) ?;
343345
344346 Ok ( ( ) )
345347 }
@@ -444,7 +446,7 @@ mod imp {
444446 & format ! ( "x-scheme-handler/{}" , _protocol. as_ref( ) ) ,
445447 ] )
446448 . output ( )
447- . map_err ( |error| crate :: Error :: Execute ( "xdg-mime" , error ) ) ?;
449+ . inspect_err ( crate :: error :: inspect_command_error ( "xdg-mime" ) ) ?;
448450
449451 Ok ( String :: from_utf8_lossy ( & output. stdout ) . contains ( & file_name) )
450452 }
You can’t perform that action at this time.
0 commit comments