{"record":{"id":"aa50edfb4d0b3500","repo":"FlowiseAI/Flowise","slug":"failed-to-monitor-job-status","errorCode":null,"errorMessage":"Failed to monitor job status","messagePattern":"Failed to monitor job status","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"info","filePath":"packages/components/nodes/documentloaders/FireCrawl/FireCrawl.ts","lineNumber":502,"sourceCode":"                switch (statusData.status) {\n                    case 'completed':\n                        isJobCompleted = true\n                        return statusData\n                    case 'scraping':\n                    case 'failed':\n                        if (statusData.status === 'failed') {\n                            throw new Error('Crawl job failed')\n                        }\n                        await new Promise((resolve) => setTimeout(resolve, Math.max(checkInterval, 2) * 1000))\n                        break\n                    default:\n                        throw new Error(`Unknown crawl status: ${statusData.status}`)\n                }\n            } else {\n                this.handleError(statusResponse, 'check crawl status')\n            }\n        }\n        throw new Error('Failed to monitor job status')\n    }\n\n    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))","sourceCodeStart":484,"sourceCodeEnd":520,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/documentloaders/FireCrawl/FireCrawl.ts#L484-L520","documentation":"Defensive throw after the `while (!isJobCompleted)` loop in monitorJobStatus. The loop body only exits via `return` (completed) or `throw` (failed/unknown/handleError), so this line is effectively unreachable in the current control flow. It exists as a TypeScript 'not all code paths return a value' satisfier.","triggerScenarios":"Reachable only if the loop variable is mutated externally or a future refactor breaks the in-loop return/throw guarantee. In the shipping code, no input reaches it.","commonSituations":"Never seen in practice; surfaces only after someone edits the switch without preserving the in-loop return.","solutions":["If you genuinely hit this, audit monitorJobStatus for a code path that sets isJobCompleted=true without returning.","Treat it as a bug report against the loader rather than a runtime concern."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { return await app.crawlUrl(url, params, true, pollInterval) }\ncatch (e) { /* unreachable per current code; treat as bug */ throw e }","preventionTips":["Treat an occurrence as a regression; audit monitorJobStatus for a path that exits the loop without returning.","Do not add retry logic — the line should never fire."],"tags":["firecrawl","crawl","unreachable","defensive"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}