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: stringView on GitHub (pinned to abe4a8601a)
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.
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
- Monitor FireCrawl credit balance; alert before exhaustion.
- Generate a fresh idempotency key per unique payload.
- Cap crawl size to avoid server timeouts (408).
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
- Unexpected error occurred while trying to ${action}. Status
- No API key provided
- Failed to scrape URL. Error: ${responseData.error}
- ${error.message}
- Crawl request failed: ${crawlResponse.error || 'Unknown erro
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/ea0521bbd3cee3e4.
Report an issue: GitHub.