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

SpiderApp.handleError for HTTP statuses 402, 408, 409, 500. These are the 'known' Spider failure statuses; the thrown message interpolates the action ('scrape URL' / 'start crawl job'), the status code, and the upstream errorMessage from response.data.error.

Source

Thrown at packages/components/nodes/documentloaders/Spider/SpiderApp.ts:110

        return { success: false, error: 'Internal server error.' }
    }

    private prepareHeaders(idempotencyKey?: string): AxiosRequestHeaders {
        return {
            'Content-Type': 'application/json',
            Authorization: `Bearer ${this.apiKey}`,
            ...(idempotencyKey ? { 'x-idempotency-key': idempotencyKey } : {})
        } as AxiosRequestHeaders & { 'x-idempotency-key'?: string }
    }

    private postRequest(url: string, data: Params, headers: AxiosRequestHeaders): Promise<AxiosResponse> {
        return secureAxiosRequest({ method: 'POST', url: `${this.apiUrl}/${url}`, data, headers })
    }

    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}`)
        }
    }
}

export default SpiderApp

View on GitHub (pinned to abe4a8601a)

Solutions

  1. 402: upgrade the Spider plan or wait for quota reset; check the dashboard.
  2. 408/500: retry with exponential backoff; check status.spider.cloud.
  3. 409: use a different idempotency key or fetch the existing job instead of resubmitting.
  4. Parse response.data.error to surface the exact upstream reason to the end user.
  5. Log the status code separately so alerting can distinguish transient from permanent.

Example fix

// before
const errorMessage: string = response.data.error || 'Unknown error occurred'
throw new Error(`Failed to ${action}. Status code: ${response.status}. Error: ${errorMessage}`)

// after
const errorMessage: string = response?.data?.error || 'Unknown error occurred'
const err = new Error(`Failed to ${action}. Status code: ${response.status}. Error: ${errorMessage}`)
;(err as any).status = response.status
throw err
Defensive patterns

Strategy: retry

Validate before calling

import axios from 'axios'
function isRetryableSpiderStatus(s: number): boolean {
    return [402, 408, 409, 429, 500, 502, 503, 504].includes(s)
}

Type guard

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

Try / catch

for (let attempt = 0; attempt < 3; attempt++) {
    try {
        return await app.crawlUrl(url, params)
    } catch (e: any) {
        const m = e.message.match(/Status code: (\d+)/)
        const status = m ? Number(m[1]) : 0
        if (status === 409) return await pollExistingJob()
        if (isRetryableSpiderStatus(status) && attempt < 2) { await sleep(2 ** attempt * 500); continue }
        throw e
    }
}

Prevention

When it happens

Trigger: Spider API responds 402 (payment/quota), 408 (request timeout), 409 (conflict — e.g. duplicate crawl), or 500 (server error). handleError is called from scrapeUrl/crawlUrl when response.status !== 200.

Common situations: Free plan quota hit (402), slow target causing Spider-side timeout (408), retrying an idempotent crawl with the same key (409), or a Spider platform incident (500).

Related errors


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