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
+3 -1
View File
@@ -67,13 +67,15 @@ async function runCheck() {
return results;
} finally {
if (browserPromise) {
const browser = await browserPromise;
const browser = await browserPromise.catch(() => null);
if (browser) {
await browser.close().catch((err) => {
console.error(`[check] kon de browser niet netjes sluiten: ${err && err.message}`);
});
}
}
}
}
startScheduler(runCheck);