Skip to content

Commit a399591

Browse files
authored
Warn if backends exist, but are not accessible
1 parent 58106a0 commit a399591

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

build.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,24 @@ fn fail(msg: &str) -> ! {
6565
fn dir_exists(location: &str) -> bool {
6666
match fs::metadata(location) {
6767
Ok(f) => f.is_dir(),
68-
Err(_) => false,
68+
Err(err) => {
69+
if err.kind() != ErrorKind::NotFound {
70+
eprintln!("WARNING: failed to access `{}`: {}", location, err);
71+
}
72+
false
73+
},
6974
}
7075
}
7176

7277
fn file_exists(location: &str) -> bool {
7378
match fs::metadata(location) {
7479
Ok(f) => f.is_file(),
75-
Err(_) => false,
80+
Err(err) => {
81+
if err.kind() != ErrorKind::NotFound {
82+
eprintln!("WARNING: failed to access `{}`: {}", location, err);
83+
}
84+
false
85+
},
7686
}
7787
}
7888

0 commit comments

Comments
 (0)