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 } ;
2
2
use svd2rust:: { util:: ToSanitizedCase , Target } ;
3
3
4
4
use crate :: { command:: CommandExt , tests:: TestCase , Opts , TestOpts } ;
@@ -213,10 +213,14 @@ impl TestCase {
213
213
}
214
214
tracing:: info!( "Downloading SVD" ) ;
215
215
// 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}" ) ) ?
218
219
. text ( )
219
220
. 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
+ }
220
224
let chip_svd = format ! ( "{}.svd" , & self . chip) ;
221
225
let svd_file = path_helper_base ( & chip_dir, & [ & chip_svd] ) ;
222
226
file_helper ( & svd, & svd_file) ?;
You can’t perform that action at this time.
0 commit comments