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 {
23
23
#[ cfg( target_os = "linux" ) ]
24
24
#[ error( transparent) ]
25
25
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 ) ,
29
26
#[ cfg( mobile) ]
30
27
#[ error( transparent) ]
31
28
PluginInvoke ( #[ from] tauri:: plugin:: mobile:: PluginInvokeError ) ,
32
29
}
33
30
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
+
34
41
impl Serialize for Error {
35
42
fn serialize < S > ( & self , serializer : S ) -> std:: result:: Result < S :: Ok , S :: Error >
36
43
where
Original file line number Diff line number Diff line change @@ -334,12 +334,14 @@ mod imp {
334
334
Command :: new ( "update-desktop-database" )
335
335
. arg ( target)
336
336
. 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
+ ) ) ?;
338
340
339
341
Command :: new ( "xdg-mime" )
340
342
. args ( [ "default" , & file_name, mime_type. as_str ( ) ] )
341
343
. status ( )
342
- . map_err ( |error| crate :: Error :: Execute ( "xdg-mime" , error ) ) ?;
344
+ . inspect_err ( crate :: error :: inspect_command_error ( "xdg-mime" ) ) ?;
343
345
344
346
Ok ( ( ) )
345
347
}
@@ -444,7 +446,7 @@ mod imp {
444
446
& format ! ( "x-scheme-handler/{}" , _protocol. as_ref( ) ) ,
445
447
] )
446
448
. output ( )
447
- . map_err ( |error| crate :: Error :: Execute ( "xdg-mime" , error ) ) ?;
449
+ . inspect_err ( crate :: error :: inspect_command_error ( "xdg-mime" ) ) ?;
448
450
449
451
Ok ( String :: from_utf8_lossy ( & output. stdout ) . contains ( & file_name) )
450
452
}
You can’t perform that action at this time.
0 commit comments