Skip to content

Commit 9cae27a

Browse files
authored
Merge pull request #2142 from Kobzol/build-script-error
Improve error message when `perf-config.json` is not found
2 parents 8627cf5 + 62ceed9 commit 9cae27a

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)