From 11a874ed3b264bd23a2c5be265f8c246105d5270 Mon Sep 17 00:00:00 2001 From: Ben Senescu <44480372+bensenescu@users.noreply.github.com> Date: Wed, 26 Aug 2026 11:51:59 -0400 Subject: [PATCH] chore: log Lighthouse runtime errors at warn and include strategy (#539) --- src/server/lib/audit/lighthouse.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/server/lib/audit/lighthouse.ts b/src/server/lib/audit/lighthouse.ts index 834e920..49ae29b 100644 --- a/src/server/lib/audit/lighthouse.ts +++ b/src/server/lib/audit/lighthouse.ts @@ -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); } }