From 62ceed92fc7acea441d5b1ff6a4ad4e0a8826e55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Wed, 28 May 2025 13:31:36 +0200 Subject: [PATCH] Improve error message when `perf-config.json` is not found Before it was quite hard to figure out what is happening. --- site/build.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/site/build.rs b/site/build.rs index 7e9acc30b..6a77cc8b8 100644 --- a/site/build.rs +++ b/site/build.rs @@ -46,7 +46,12 @@ fn main() -> Result<(), Box> { // Load perf-config.json let config_path = compile_benchmark.path().join("perf-config.json"); - let config_contents = std::fs::read_to_string(config_path)?; + let config_contents = std::fs::read_to_string(&config_path).map_err(|e| { + format!( + "Cannot read perf-config.json file at {}: {e:?}", + config_path.display() + ) + })?; let config = serde_json::from_str::(&config_contents)?; // Load Cargo manifest to find profile information