{"record":{"id":"ea0521bbd3cee3e4","repo":"FlowiseAI/Flowise","slug":"failed-to-action-status-code-response-statu","errorCode":null,"errorMessage":"Failed to ${action}. Status code: ${response.status}. Error: ${errorMessage}","messagePattern":"Failed to (.+?)\\. Status code: (.+?)\\. Error: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/documentloaders/FireCrawl/FireCrawl.ts","lineNumber":535,"sourceCode":"                        if (statusData.status === 'failed') {\n                            throw new Error('Extract job failed')\n                        }\n                        await new Promise((resolve) => setTimeout(resolve, Math.max(checkInterval, 2) * 1000))\n                        break\n                    default:\n                        throw new Error(`Unknown extract status: ${statusData.status}`)\n                }\n            } else {\n                this.handleError(statusResponse, 'check extract status')\n            }\n        }\n        throw new Error('Failed to monitor extract status')\n    }\n\n    private handleError(response: AxiosResponse, action: string): void {\n        if ([402, 408, 409, 500].includes(response.status)) {\n            const errorMessage: string = response.data.error || 'Unknown error occurred'\n            throw new Error(`Failed to ${action}. Status code: ${response.status}. Error: ${errorMessage}`)\n        } else {\n            throw new Error(`Unexpected error occurred while trying to ${action}. Status code: ${response.status}`)\n        }\n    }\n}\n\n// FireCrawl Loader\ninterface FirecrawlLoaderParameters {\n    url?: string\n    query?: string\n    apiKey?: string\n    apiUrl?: string\n    mode?: 'crawl' | 'scrape' | 'extract' | 'search'\n    params?: Record<string, unknown>\n}\n\nexport class FireCrawlLoader extends BaseDocumentLoader {\n    private apiKey: string","sourceCodeStart":517,"sourceCodeEnd":553,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/documentloaders/FireCrawl/FireCrawl.ts#L517-L553","documentation":"Thrown by handleError when the HTTP status is one of {402, 408, 409, 500} — the statuses FireCrawl treats as having a structured error body. Embeds status code and `response.data.error` (or 'Unknown error occurred'). This is the shared error channel for scrape/crawl/extract/search status-check failures.","triggerScenarios":"402 Payment Required (out of credits), 408 Request Timeout, 409 Conflict (e.g. duplicate idempotency key), 500 Internal Server Error. The body's `data.error` field carries the upstream message.","commonSituations":"Free plan exhausted (402); long crawl exceeding server timeout (408); replayed idempotency key with different payload (409); FireCrawl incident (500).","solutions":["402: top up FireCrawl credits or upgrade plan.","408: reduce crawl size (limit/maxDepth) or raise server-side timeout.","409: use a fresh idempotency key per unique payload, or omit it.","500: check status.firecrawl.dev and retry with backoff.","Always log `response.data.error` — it disambiguates the status code."],"exampleFix":"// before\nthis.handleError(response, 'start crawl job')\n\n// after (caller)\ntry { await app.crawlUrl(url, params) }\ncatch (e) {\n  if (/Status code: 402/.test(e.message)) alert('Out of FireCrawl credits')\n  else if (/Status code: 409/.test(e.message)) { /* retry with new key */ }\n  else throw e\n}","handlingStrategy":"try-catch","validationCode":"if (!apiKey) throw new Error('apiKey required')\nif (idempotencyKey && seenKeys.has(idempotencyKey)) throw new Error('reuse of idempotency key')","typeGuard":"function isBillingStatus(status: number): boolean {\n  return [402, 408, 409, 500].includes(status)\n}","tryCatchPattern":"try { return await op() }\ncatch (e) {\n  const m = (e as Error).message\n  if (/Status code: 402/.test(m)) throw new Error('Out of FireCrawl credits')\n  if (/Status code: 409/.test(m)) { /* retry with fresh idempotency key */ }\n  if (/Status code: 5/.test(m)) { await sleep(backoff); return op() }\n  throw e\n}","preventionTips":["Monitor FireCrawl credit balance; alert before exhaustion.","Generate a fresh idempotency key per unique payload.","Cap crawl size to avoid server timeouts (408)."],"tags":["firecrawl","http-status","billing","conflict","timeout"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}