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:
@@ -67,12 +67,14 @@ 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);
|
||||
|
||||
Reference in New Issue
Block a user