@@ -254,6 +254,7 @@ mod imp {
254254 ///
255255 /// ## Platform-specific:
256256 ///
257+ /// - **Linux**: Needs the `xdg-mime` and `update-desktop-database` commands available on the system.
257258 /// - **macOS / Android / iOS**: Unsupported, will return [`Error::UnsupportedPlatform`](`crate::Error::UnsupportedPlatform`).
258259 pub fn register < S : AsRef < str > > ( & self , _protocol : S ) -> crate :: Result < ( ) > {
259260 #[ cfg( windows) ]
@@ -332,11 +333,13 @@ mod imp {
332333
333334 Command :: new ( "update-desktop-database" )
334335 . arg ( target)
335- . status ( ) ?;
336+ . status ( )
337+ . map_err ( |error| crate :: Error :: Execute ( "update-desktop-database" , error) ) ?;
336338
337339 Command :: new ( "xdg-mime" )
338340 . args ( [ "default" , & file_name, mime_type. as_str ( ) ] )
339- . status ( ) ?;
341+ . status ( )
342+ . map_err ( |error| crate :: Error :: Execute ( "xdg-mime" , error) ) ?;
340343
341344 Ok ( ( ) )
342345 }
@@ -405,6 +408,7 @@ mod imp {
405408 ///
406409 /// ## Platform-specific:
407410 ///
411+ /// - **Linux**: Needs the `xdg-mime` command available on the system.
408412 /// - **macOS / Android / iOS**: Unsupported, will return [`Error::UnsupportedPlatform`](`crate::Error::UnsupportedPlatform`).
409413 pub fn is_registered < S : AsRef < str > > ( & self , _protocol : S ) -> crate :: Result < bool > {
410414 #[ cfg( windows) ]
@@ -439,7 +443,8 @@ mod imp {
439443 "default" ,
440444 & format ! ( "x-scheme-handler/{}" , _protocol. as_ref( ) ) ,
441445 ] )
442- . output ( ) ?;
446+ . output ( )
447+ . map_err ( |error| crate :: Error :: Execute ( "xdg-mime" , error) ) ?;
443448
444449 Ok ( String :: from_utf8_lossy ( & output. stdout ) . contains ( & file_name) )
445450 }
0 commit comments