@mendable/firecrawl-js 0.0.20 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +1 -1
- package/package.json +1 -1
- package/src/index.ts +2 -2
package/build/index.js
CHANGED
|
@@ -240,7 +240,7 @@ export default class FirecrawlApp {
|
|
|
240
240
|
* @param {string} action - The action being performed when the error occurred.
|
|
241
241
|
*/
|
|
242
242
|
handleError(response, action) {
|
|
243
|
-
if ([402, 409, 500].includes(response.status)) {
|
|
243
|
+
if ([402, 408, 409, 500].includes(response.status)) {
|
|
244
244
|
const errorMessage = response.data.error || "Unknown error occurred";
|
|
245
245
|
throw new Error(`Failed to ${action}. Status code: ${response.status}. Error: ${errorMessage}`);
|
|
246
246
|
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -109,7 +109,7 @@ export default class FirecrawlApp {
|
|
|
109
109
|
const response: AxiosResponse = await axios.post(
|
|
110
110
|
"https://api.firecrawl.dev/v0/scrape",
|
|
111
111
|
jsonData,
|
|
112
|
-
{ headers }
|
|
112
|
+
{ headers },
|
|
113
113
|
);
|
|
114
114
|
if (response.status === 200) {
|
|
115
115
|
const responseData = response.data;
|
|
@@ -324,7 +324,7 @@ export default class FirecrawlApp {
|
|
|
324
324
|
* @param {string} action - The action being performed when the error occurred.
|
|
325
325
|
*/
|
|
326
326
|
handleError(response: AxiosResponse, action: string): void {
|
|
327
|
-
if ([402, 409, 500].includes(response.status)) {
|
|
327
|
+
if ([402, 408, 409, 500].includes(response.status)) {
|
|
328
328
|
const errorMessage: string =
|
|
329
329
|
response.data.error || "Unknown error occurred";
|
|
330
330
|
throw new Error(
|