@@ -10,7 +10,7 @@ use std::path::PathBuf;
1010use std:: fs:: remove_dir_all;
1111use postgres:: Connection ;
1212use 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