@@ -254,6 +254,7 @@ mod imp {
254
254
///
255
255
/// ## Platform-specific:
256
256
///
257
+ /// - **Linux**: Needs the `xdg-mime` and `update-desktop-database` commands available on the system.
257
258
/// - **macOS / Android / iOS**: Unsupported, will return [`Error::UnsupportedPlatform`](`crate::Error::UnsupportedPlatform`).
258
259
pub fn register < S : AsRef < str > > ( & self , _protocol : S ) -> crate :: Result < ( ) > {
259
260
#[ cfg( windows) ]
@@ -332,11 +333,13 @@ mod imp {
332
333
333
334
Command :: new ( "update-desktop-database" )
334
335
. arg ( target)
335
- . status ( ) ?;
336
+ . status ( )
337
+ . map_err ( |error| crate :: Error :: Execute ( "update-desktop-database" , error) ) ?;
336
338
337
339
Command :: new ( "xdg-mime" )
338
340
. args ( [ "default" , & file_name, mime_type. as_str ( ) ] )
339
- . status ( ) ?;
341
+ . status ( )
342
+ . map_err ( |error| crate :: Error :: Execute ( "xdg-mime" , error) ) ?;
340
343
341
344
Ok ( ( ) )
342
345
}
@@ -405,6 +408,7 @@ mod imp {
405
408
///
406
409
/// ## Platform-specific:
407
410
///
411
+ /// - **Linux**: Needs the `xdg-mime` command available on the system.
408
412
/// - **macOS / Android / iOS**: Unsupported, will return [`Error::UnsupportedPlatform`](`crate::Error::UnsupportedPlatform`).
409
413
pub fn is_registered < S : AsRef < str > > ( & self , _protocol : S ) -> crate :: Result < bool > {
410
414
#[ cfg( windows) ]
@@ -439,7 +443,8 @@ mod imp {
439
443
"default" ,
440
444
& format ! ( "x-scheme-handler/{}" , _protocol. as_ref( ) ) ,
441
445
] )
442
- . output ( ) ?;
446
+ . output ( )
447
+ . map_err ( |error| crate :: Error :: Execute ( "xdg-mime" , error) ) ?;
443
448
444
449
Ok ( String :: from_utf8_lossy ( & output. stdout ) . contains ( & file_name) )
445
450
}
0 commit comments