chore: log Lighthouse runtime errors at warn and include strategy (#539)

This commit is contained in:
Ben Senescu 2026-08-26 11:51:59 -04:00 committed by GitHub
parent c7ff28c30a
commit 11a874ed3b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -76,7 +76,15 @@ export async function fetchLighthouseResult(
};
} catch (error) {
const failed = error instanceof Error ? error : new Error(String(error));
console.error(`Lighthouse failed for ${url}:`, failed.message);
// Lighthouse runtime errors (ERRORED_DOCUMENT_REQUEST, NOT_HTML, NO_FCP) mean the
// tenant's page didn't load for the provider's Chrome. The failure is already
// surfaced on the audit row, so there is nothing for us to act on.
const log = failed.message.includes(
"Lighthouse encountered an error with the following code",
)
? console.warn
: console.error;
log(`Lighthouse failed for ${url} (${strategy}): ${failed.message}`);
return failedLighthouseFetch(url, pageId, strategy, failed.message);
}
}