Skip to content

Commit 62ceed9

Browse files
committed
Improve error message when perf-config.json is not found
Before it was quite hard to figure out what is happening.
1 parent 8627cf5 commit 62ceed9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

site/build.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,12 @@ fn main() -> Result<(), Box<dyn Error>> {
4646

4747
// Load perf-config.json
4848
let config_path = compile_benchmark.path().join("perf-config.json");
49-
let config_contents = std::fs::read_to_string(config_path)?;
49+
let config_contents = std::fs::read_to_string(&config_path).map_err(|e| {
50+
format!(
51+
"Cannot read perf-config.json file at {}: {e:?}",
52+
config_path.display()
53+
)
54+
})?;
5055
let config = serde_json::from_str::<serde_json::Value>(&config_contents)?;
5156

5257
// Load Cargo manifest to find profile information

0 commit comments

Comments
 (0)