fix: don't let a failed browser launch override a successful runCheck result

Guard the finally block's re-await of browserPromise so a rejected
launch (e.g. Playwright can't start Chromium) doesn't rethrow out of
finally and override the try block's already-successful return value.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013gwc3aCiyQxmCWQke8RvEz
This commit is contained in:
Sjoerd de Vries
2026-09-05 17:44:29 +02:00
parent fc8dadc8a3
commit 966a80c690
+6 -4
View File
@@ -67,10 +67,12 @@ async function runCheck() {
return results; return results;
} finally { } finally {
if (browserPromise) { if (browserPromise) {
const browser = await browserPromise; const browser = await browserPromise.catch(() => null);
await browser.close().catch((err) => { if (browser) {
console.error(`[check] kon de browser niet netjes sluiten: ${err && err.message}`); await browser.close().catch((err) => {
}); console.error(`[check] kon de browser niet netjes sluiten: ${err && err.message}`);
});
}
} }
} }
} }