File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3838 with :
3939 chrome-version : ' latest'
4040 install-chromedriver : true
41+ id : setup-chrome
4142 - uses : dtolnay/rust-toolchain@stable
4243 with :
4344 components : clippy
Original file line number Diff line number Diff line change @@ -174,19 +174,19 @@ fn setup_driver(config: &WebdriverDownloadConfig) -> Result<()> {
174174 match config. driver_name {
175175 CHROMEDRIVER_NAME => {
176176 let driver_info = ChromedriverInfo :: new ( webdriver_bin. clone ( ) , browser_path) ;
177- runtime
178- . block_on ( async { download_with_retry ( & driver_info, false , true , 1 ) . await } )
179- . with_context ( || {
180- format ! ( "Failed to download and install {}" , config . driver_name )
181- } ) ? ;
177+ let dl_res =
178+ runtime . block_on ( async { download_with_retry ( & driver_info, false , true , 1 ) . await } ) ;
179+ if let Err ( e ) = dl_res {
180+ return Err ( anyhow ! ( "Failed to download and install chromedriver" ) . context ( e ) ) ;
181+ }
182182 }
183183 GECKODRIVER_NAME => {
184184 let driver_info = GeckodriverInfo :: new ( webdriver_bin. clone ( ) , browser_path) ;
185- runtime
186- . block_on ( async { download_with_retry ( & driver_info, false , true , 1 ) . await } )
187- . with_context ( || {
188- format ! ( "Failed to download and install {}" , config . driver_name )
189- } ) ? ;
185+ let dl_res =
186+ runtime . block_on ( async { download_with_retry ( & driver_info, false , true , 1 ) . await } ) ;
187+ if let Err ( e ) = dl_res {
188+ return Err ( anyhow ! ( "Failed to download and install geckodriver" ) . context ( e ) ) ;
189+ }
190190 }
191191 _ => return Err ( anyhow ! ( "Unsupported driver type: {}" , config. driver_name) ) ,
192192 }
Original file line number Diff line number Diff line change @@ -778,7 +778,7 @@ impl StaticExporter {
778778 /// # Examples
779779 ///
780780 /// ```no_run
781- ///
781+ ///
782782 /// // This example requires a running WebDriver (chromedriver/geckodriver) and a browser.
783783 /// // It cannot be run as a doc test.
784784 ///
@@ -841,7 +841,7 @@ impl StaticExporter {
841841 /// # Examples
842842 ///
843843 /// ```no_run
844- ///
844+ ///
845845 /// // This example requires a running WebDriver (chromedriver/geckodriver) and a browser.
846846 /// // It cannot be run as a doc test.
847847 /// use plotly_static::{StaticExporterBuilder, ImageFormat};
You can’t perform that action at this time.
0 commit comments