Skip to content

Commit 2da07f1

Browse files
Improve errors during add_essential_files
1 parent 4a9cb42 commit 2da07f1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/docbuilder/chroot_builder.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use std::path::PathBuf;
1010
use std::fs::remove_dir_all;
1111
use postgres::Connection;
1212
use rustc_serialize::json::Json;
13-
use error::Result;
13+
use error::{Result, ResultExt};
1414

1515

1616
/// List of targets supported by docs.rs
@@ -398,13 +398,15 @@ impl DocBuilder {
398398
let file_name = format!("{}-{}.{}", spl[0], rustc_version, spl[1]);
399399
let source_path = source.join(&file_name);
400400
let destination_path = destination.join(&file_name);
401-
try!(copy(source_path, destination_path));
401+
try!(copy(&source_path, &destination_path)
402+
.chain_err(|| format!("couldn't copy '{}' to '{}'", source_path.display(), destination_path.display())));
402403
}
403404

404405
for file in files.1.iter() {
405406
let source_path = source.join(file);
406407
let destination_path = destination.join(file);
407-
try!(copy(source_path, destination_path));
408+
try!(copy(&source_path, &destination_path)
409+
.chain_err(|| format!("couldn't copy '{}' to '{}'", source_path.display(), destination_path.display())));
408410
}
409411

410412
let conn = try!(connect_db());

0 commit comments

Comments
 (0)