FlowiseAI/Flowise · info · Error

Failed to monitor job status

Error message

Failed to monitor job status

What it means

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.

Source

Thrown at packages/components/nodes/documentloaders/FireCrawl/FireCrawl.ts:502

                switch (statusData.status) {
                    case 'completed':
                        isJobCompleted = true
                        return statusData
                    case 'scraping':
                    case 'failed':
                        if (statusData.status === 'failed') {
                            throw new Error('Crawl job failed')
                        }
                        await new Promise((resolve) => setTimeout(resolve, Math.max(checkInterval, 2) * 1000))
                        break
                    default:
                        throw new Error(`Unknown crawl status: ${statusData.status}`)
                }
            } else {
                this.handleError(statusResponse, 'check crawl status')
            }
        }
        throw new Error('Failed to monitor job status')
    }

    private async monitorExtractStatus(jobId: string, headers: AxiosRequestHeaders, checkInterval: number): Promise<ExtractStatusResponse> {
        let isJobCompleted = false
        while (!isJobCompleted) {
            const statusResponse: AxiosResponse = await this.getRequest(this.apiUrl + `/v1/extract/${jobId}`, headers)
            if (statusResponse.status === 200) {
                const statusData = statusResponse.data as ExtractStatusResponse
                switch (statusData.status) {
                    case 'completed':
                        isJobCompleted = true
                        return statusData
                    case 'processing':
                    case 'failed':
                        if (statusData.status === 'failed') {
                            throw new Error('Extract job failed')
                        }
                        await new Promise((resolve) => setTimeout(resolve, Math.max(checkInterval, 2) * 1000))

View on GitHub (pinned to abe4a8601a)

Solutions

  1. If you genuinely hit this, audit monitorJobStatus for a code path that sets isJobCompleted=true without returning.
  2. Treat it as a bug report against the loader rather than a runtime concern.
Defensive patterns

Strategy: try-catch

Try / catch

try { return await app.crawlUrl(url, params, true, pollInterval) }
catch (e) { /* unreachable per current code; treat as bug */ throw e }

Prevention

When it happens

Trigger: 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.

Common situations: Never seen in practice; surfaces only after someone edits the switch without preserving the in-loop return.

Related errors


AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12). Data as JSON: /api/errors/aa50edfb4d0b3500. Report an issue: GitHub.