{"record":{"id":"47fd827b97ca77ca","repo":"FlowiseAI/Flowise","slug":"unknown-extract-status-statusdata-status","errorCode":null,"errorMessage":"Unknown extract status: ${statusData.status}","messagePattern":"Unknown extract status: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/documentloaders/FireCrawl/FireCrawl.ts","lineNumber":523,"sourceCode":"    private async monitorExtractStatus(jobId: string, headers: AxiosRequestHeaders, checkInterval: number): Promise<ExtractStatusResponse> {\n        let isJobCompleted = false\n        while (!isJobCompleted) {\n            const statusResponse: AxiosResponse = await this.getRequest(this.apiUrl + `/v1/extract/${jobId}`, headers)\n            if (statusResponse.status === 200) {\n                const statusData = statusResponse.data as ExtractStatusResponse\n                switch (statusData.status) {\n                    case 'completed':\n                        isJobCompleted = true\n                        return statusData\n                    case 'processing':\n                    case 'failed':\n                        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","sourceCodeStart":505,"sourceCodeEnd":541,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/documentloaders/FireCrawl/FireCrawl.ts#L505-L541","documentation":"Thrown by monitorExtractStatus when the extract-status response carries a `status` outside the handled set {'completed','processing','failed'}. Any new state (e.g. 'pending','queued','cancelled') trips the default branch.","triggerScenarios":"ExtractStatusResponse interface declares status as 'completed'|'pending'|'processing'|'failed'|'cancelled', but the switch only handles completed/processing/failed — so 'pending' and 'cancelled' both fall through to this throw.","commonSituations":"Job is still pending (not yet processing) — polling started too early; job cancelled from FireCrawl dashboard; new FireCrawl API status added.","solutions":["Add 'pending' to the in-progress branch so early polls don't crash: `case 'pending': case 'processing':`.","Handle 'cancelled' explicitly (re-throw or restart).","Insert an initial small delay before the first poll if you control the caller."],"exampleFix":"// before\ncase 'processing': case 'failed': ...\ndefault: throw new Error(`Unknown extract status: ${statusData.status}`)\n\n// after\ncase 'pending': case 'processing':\n  await sleep(Math.max(checkInterval, 2) * 1000); break\ncase 'failed': case 'cancelled':\n  throw new Error(statusData.status)\ndefault: throw new Error(`Unknown extract status: ${statusData.status}`)","handlingStrategy":"type-guard","validationCode":"const safe = new Set(['completed','processing','failed'])\nif (!safe.has(statusData.status)) console.warn('unhandled extract status:', statusData.status)","typeGuard":"function isKnownExtractStatus(s: string): boolean {\n  return ['completed','pending','processing','failed','cancelled'].includes(s)\n}","tryCatchPattern":"try { return await app.extract(req) }\ncatch (e) {\n  if (/Unknown extract status:/.test((e as Error).message)) { await sleep(2000); return app.extract(req) }\n  throw e\n}","preventionTips":["Patch the switch to handle 'pending' and 'cancelled'.","Add a small initial delay before the first poll.","Pin API version if a new status appears."],"tags":["firecrawl","extract","status-enum","polling"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}