Handle malformed optional benchmark summaries

This commit is contained in:
Chirag Aggarwal committed 2026-04-22 12:06:32 +05:30
1 parent a0ef5968fb
commit a98b9f2319
1 file changed
+5 -1
+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;
}
}