File tree 2 files changed +11
-2
lines changed
2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -394,7 +394,10 @@ impl Config {
394
394
395
395
walk_tree ( & self . cwd , |mut file, path| {
396
396
let mut contents = String :: new ( ) ;
397
- file. read_to_string ( & mut contents) ?;
397
+ file. read_to_string ( & mut contents) . chain_error ( || {
398
+ human ( format ! ( "failed to read configuration file `{}`" ,
399
+ path. display( ) ) )
400
+ } ) ?;
398
401
let toml = cargo_toml:: parse ( & contents,
399
402
& path,
400
403
self ) . chain_error ( || {
@@ -405,7 +408,10 @@ impl Config {
405
408
human ( format ! ( "failed to load TOML configuration from `{}`" ,
406
409
path. display( ) ) )
407
410
} ) ?;
408
- cfg. merge ( value) ?;
411
+ cfg. merge ( value) . chain_error ( || {
412
+ human ( format ! ( "failed to merge configuration at `{}`" ,
413
+ path. display( ) ) )
414
+ } ) ?;
409
415
Ok ( ( ) )
410
416
} ) . chain_error ( || human ( "Couldn't load Cargo configuration" ) ) ?;
411
417
Original file line number Diff line number Diff line change @@ -120,6 +120,9 @@ fn bad5() {
120
120
Caused by:
121
121
Couldn't load Cargo configuration
122
122
123
+ Caused by:
124
+ failed to merge configuration at `[..]`
125
+
123
126
Caused by:
124
127
failed to merge key `foo` between files:
125
128
file 1: [..]foo[..]foo[..]config
You can’t perform that action at this time.
0 commit comments