File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
migration/util/node-types/src/executor Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -35,20 +35,20 @@ pub struct MovementNode {
35
35
}
36
36
37
37
/// Copies a directory recursively.
38
- fn copy_dir_recursive ( src : & Path , dst : & Path ) -> std :: io :: Result < ( ) > {
38
+ fn copy_dir_recursive ( src : & Path , dst : & Path ) -> Result < ( ) , anyhow :: Error > {
39
39
40
40
// make sure the dst directory exists
41
- fs:: create_dir_all ( dst) ?;
41
+ fs:: create_dir_all ( dst) . context ( format ! ( "failed to create debug directory: {}" , dst . display ( ) ) ) ?;
42
42
43
43
for entry in WalkDir :: new ( src) {
44
44
let entry = entry?;
45
45
let rel_path = entry. path ( ) . strip_prefix ( src) . unwrap ( ) ;
46
46
let dest_path = dst. join ( rel_path) ;
47
47
48
48
if entry. file_type ( ) . is_dir ( ) {
49
- fs:: create_dir_all ( & dest_path) ?;
49
+ fs:: create_dir_all ( & dest_path) . context ( format ! ( "failed to create directory: {}" , dest_path . display ( ) ) ) ?;
50
50
} else {
51
- fs:: copy ( entry. path ( ) , & dest_path) ?;
51
+ fs:: copy ( entry. path ( ) , & dest_path) . context ( format ! ( "failed to copy file: {}" , entry . path ( ) . display ( ) ) ) ?;
52
52
}
53
53
}
54
54
Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments