diff --git a/api/src/routes/fcc-lookup.ts b/api/src/routes/fcc-lookup.ts index 4537e49..e565d7a 100644 --- a/api/src/routes/fcc-lookup.ts +++ b/api/src/routes/fcc-lookup.ts @@ -1280,16 +1280,14 @@ router.get("/api/v1/fcc/cores-search", async (req, res) => { }); if (!resp.ok) { - res.status(502).json({ error: `The FCC search system is temporarily unavailable (HTTP ${resp.status}). Try searching by FRN instead, or try again in a few minutes.` }); - return; + throw new Error(`FCC returned HTTP ${resp.status}`); } const html = await resp.text(); // FCC sometimes returns 200 but with a maintenance/error page - if (html.includes("Service Unavailable") || (html.includes("503") && !html.includes("499results"))) { - res.status(502).json({ error: "The FCC search system is temporarily unavailable. Try searching by FRN instead, or try again in a few minutes." }); - return; + if (html.includes("Service Unavailable") || html.includes("FCC Website Error") || (html.includes("503") && !html.includes("499results"))) { + throw new Error("FCC search returned maintenance page"); } // Parse the results table rows: