FlowiseAI/Flowise · error · Error

Failed to ${action}. Status code: ${response.status}. Error:

Error message

Failed to ${action}. Status code: ${response.status}. Error: ${errorMessage}

What it means

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.

Source

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

                        if (statusData.status === 'failed') {
                            throw new Error('Extract job failed')
                        }
                        await new Promise((resolve) => setTimeout(resolve, Math.max(checkInterval, 2) * 1000))
                        break
                    default:
                        throw new Error(`Unknown extract status: ${statusData.status}`)
                }
            } else {
                this.handleError(statusResponse, 'check extract status')
            }
        }
        throw new Error('Failed to monitor extract status')
    }

    private handleError(response: AxiosResponse, action: string): void {
        if ([402, 408, 409, 500].includes(response.status)) {
            const errorMessage: string = response.data.error || 'Unknown error occurred'
            throw new Error(`Failed to ${action}. Status code: ${response.status}. Error: ${errorMessage}`)
        } else {
            throw new Error(`Unexpected error occurred while trying to ${action}. Status code: ${response.status}`)
        }
    }
}

// FireCrawl Loader
interface FirecrawlLoaderParameters {
    url?: string
    query?: string
    apiKey?: string
    apiUrl?: string
    mode?: 'crawl' | 'scrape' | 'extract' | 'search'
    params?: Record<string, unknown>
}

export class FireCrawlLoader extends BaseDocumentLoader {
    private apiKey: string

View on GitHub (pinned to abe4a8601a)

Solutions

  1. 402: top up FireCrawl credits or upgrade plan.
  2. 408: reduce crawl size (limit/maxDepth) or raise server-side timeout.
  3. 409: use a fresh idempotency key per unique payload, or omit it.
  4. 500: check status.firecrawl.dev and retry with backoff.
  5. Always log `response.data.error` — it disambiguates the status code.

Example fix

// before
this.handleError(response, 'start crawl job')

// after (caller)
try { await app.crawlUrl(url, params) }
catch (e) {
  if (/Status code: 402/.test(e.message)) alert('Out of FireCrawl credits')
  else if (/Status code: 409/.test(e.message)) { /* retry with new key */ }
  else throw e
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (!apiKey) throw new Error('apiKey required')
if (idempotencyKey && seenKeys.has(idempotencyKey)) throw new Error('reuse of idempotency key')

Type guard

function isBillingStatus(status: number): boolean {
  return [402, 408, 409, 500].includes(status)
}

Try / catch

try { return await op() }
catch (e) {
  const m = (e as Error).message
  if (/Status code: 402/.test(m)) throw new Error('Out of FireCrawl credits')
  if (/Status code: 409/.test(m)) { /* retry with fresh idempotency key */ }
  if (/Status code: 5/.test(m)) { await sleep(backoff); return op() }
  throw e
}

Prevention

When it happens

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

Common situations: Free plan exhausted (402); long crawl exceeding server timeout (408); replayed idempotency key with different payload (409); FireCrawl incident (500).

Related errors


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