@@ -313,8 +313,12 @@ impl Manifestation {
313
313
314
314
// Read configuration and delete it
315
315
let rel_config_path = prefix. rel_manifest_file ( CONFIG_FILE ) ;
316
- let config_str = utils:: read_file ( "dist config" , & prefix. path ( ) . join ( & rel_config_path) ) ?;
317
- let config = Config :: parse ( & config_str) ?;
316
+ let abs_config_path = prefix. path ( ) . join ( & rel_config_path) ;
317
+ let config_str = utils:: read_file ( "dist config" , & abs_config_path) ?;
318
+ let config = Config :: parse ( & config_str) . with_context ( || RustupError :: ParsingFile {
319
+ name : "config" ,
320
+ path : abs_config_path,
321
+ } ) ?;
318
322
tx. remove_file ( "dist config" , rel_config_path) ?;
319
323
320
324
for component in config. components {
@@ -359,7 +363,12 @@ impl Manifestation {
359
363
let config_path = prefix. path ( ) . join ( rel_config_path) ;
360
364
if utils:: path_exists ( & config_path) {
361
365
let config_str = utils:: read_file ( "dist config" , & config_path) ?;
362
- Ok ( Some ( Config :: parse ( & config_str) ?) )
366
+ Ok ( Some ( Config :: parse ( & config_str) . with_context ( || {
367
+ RustupError :: ParsingFile {
368
+ name : "Config" ,
369
+ path : config_path,
370
+ }
371
+ } ) ?) )
363
372
} else {
364
373
Ok ( None )
365
374
}
@@ -371,7 +380,12 @@ impl Manifestation {
371
380
let old_manifest_path = prefix. manifest_file ( DIST_MANIFEST ) ;
372
381
if utils:: path_exists ( & old_manifest_path) {
373
382
let manifest_str = utils:: read_file ( "installed manifest" , & old_manifest_path) ?;
374
- Ok ( Some ( Manifest :: parse ( & manifest_str) ?) )
383
+ Ok ( Some ( Manifest :: parse ( & manifest_str) . with_context ( || {
384
+ RustupError :: ParsingFile {
385
+ name : "manifest" ,
386
+ path : old_manifest_path,
387
+ }
388
+ } ) ?) )
375
389
} else {
376
390
Ok ( None )
377
391
}
0 commit comments