File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 1- use anyhow:: { Context , Result } ;
1+ use anyhow:: { anyhow , Context , Result } ;
22use svd2rust:: { util:: ToSanitizedCase , Target } ;
33
44use crate :: { command:: CommandExt , tests:: TestCase , Opts , TestOpts } ;
@@ -213,10 +213,14 @@ impl TestCase {
213213 }
214214 tracing:: info!( "Downloading SVD" ) ;
215215 // FIXME: Avoid downloading multiple times, especially if we're using the diff command
216- let svd = reqwest:: blocking:: get ( self . svd_url ( ) )
217- . with_context ( || "Failed to get svd URL" ) ?
216+ let svd_url = & self . svd_url ( ) ;
217+ let svd = reqwest:: blocking:: get ( svd_url)
218+ . with_context ( || format ! ( "Failed to get svd URL: {svd_url}" ) ) ?
218219 . text ( )
219220 . with_context ( || "SVD is bad text" ) ?;
221+ if svd == "404: Not Found" {
222+ return Err ( anyhow ! ( "Failed to get svd URL: {svd_url}. {svd}" ) . into ( ) ) ;
223+ }
220224 let chip_svd = format ! ( "{}.svd" , & self . chip) ;
221225 let svd_file = path_helper_base ( & chip_dir, & [ & chip_svd] ) ;
222226 file_helper ( & svd, & svd_file) ?;
You can’t perform that action at this time.
0 commit comments