From aa0c8188c9d4d11c128474d3cf7f322ee72d326b Mon Sep 17 00:00:00 2001 From: Nicolas Date: Mon, 13 May 2024 18:34:00 -0700 Subject: [PATCH] Nick: 408 handling --- apps/js-sdk/firecrawl/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/js-sdk/firecrawl/src/index.ts b/apps/js-sdk/firecrawl/src/index.ts index 0319c74..7654f1b 100644 --- a/apps/js-sdk/firecrawl/src/index.ts +++ b/apps/js-sdk/firecrawl/src/index.ts @@ -109,7 +109,7 @@ export default class FirecrawlApp { const response: AxiosResponse = await axios.post( "https://api.firecrawl.dev/v0/scrape", jsonData, - { headers } + { headers }, ); if (response.status === 200) { const responseData = response.data; @@ -324,7 +324,7 @@ export default class FirecrawlApp { * @param {string} action - The action being performed when the error occurred. */ handleError(response: AxiosResponse, action: string): void { - if ([402, 409, 500].includes(response.status)) { + if ([402, 408, 409, 500].includes(response.status)) { const errorMessage: string = response.data.error || "Unknown error occurred"; throw new Error(