Handle malformed optional benchmark summaries

This commit is contained in:
Chirag Aggarwal
2026-04-22 12:06:32 +05:30
parent a0ef5968fb
commit a98b9f2319
+5 -1
View File
@@ -778,7 +778,11 @@ jobs:
try {
return JSON.parse(fs.readFileSync(path, 'utf8'));
} catch (error) {
throw new Error(`Invalid benchmark summary ${path}: ${error.message}`);
if (required) {
throw new Error(`Invalid benchmark summary ${path}: ${error.message}`);
}
console.error(`Invalid benchmark summary ${path}: ${error.message}`);
return null;
}
}