diff --git a/scripts/check-http.ts b/scripts/check-http.ts index 474113a..c39945a 100644 --- a/scripts/check-http.ts +++ b/scripts/check-http.ts @@ -75,15 +75,14 @@ async function main() { ); process.exit(0); } - } catch (error: any) { - if (error.response) { + } catch (e: unknown) { + if (axios.isAxiosError(e) && e.response) { console.error( - `\n❌ Critical Error during Sitemap Fetch: HTTP ${error.response.status} ${error.response.statusText}`, + `\n❌ Critical Error during Sitemap Fetch: HTTP ${e.response.status} ${e.response.statusText}`, ); } else { - console.error( - `\n❌ Critical Error during Sitemap Fetch: ${error.message || error}`, - ); + const errorMsg = e instanceof Error ? e.message : String(e); + console.error(`\n❌ Critical Error during Sitemap Fetch: ${errorMsg}`); } process.exit(1); }