FlowiseAI/Flowise · error · Error

${error.message}

Error message

${error.message}

What it means

Generic rethrow in scrapeUrl's catch. Any error thrown inside the try (including the structured failure from error 188, handleError's throws, axios/network errors) is flattened to `new Error(error.message)`, destroying the stack trace, error class, and any status code context.

Source

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

    async scrapeUrl(url: string, params: Params | null = null): Promise<ScrapeResponse> {
        const headers = this.prepareHeaders()
        const jsonData: Params = { url, limit: 1, ...params }

        try {
            const response: AxiosResponse = await this.postRequest('crawl', jsonData, headers)
            if (response.status === 200) {
                const responseData = response.data
                if (responseData[0].status) {
                    return { success: true, data: responseData[0] }
                } else {
                    throw new Error(`Failed to scrape URL. Error: ${responseData.error}`)
                }
            } else {
                this.handleError(response, 'scrape URL')
            }
        } catch (error: any) {
            throw new Error(error.message)
        }
        return { success: false, error: 'Internal server error.' }
    }

    async crawlUrl(url: string, params: Params | null = null, idempotencyKey?: string): Promise<CrawlResponse | any> {
        const headers = this.prepareHeaders(idempotencyKey)
        const jsonData: Params = { url, ...params }

        try {
            const response: AxiosResponse = await this.postRequest('crawl', jsonData, headers)
            if (response.status === 200) {
                return { success: true, data: response.data }
            } else {
                this.handleError(response, 'start crawl job')
            }
        } catch (error: any) {
            throw new Error(error.message)
        }

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Re-throw the original error instead of wrapping: `throw error` when it is already an Error.
  2. Or attach cause: `throw new Error(msg, { cause: error })` to preserve the stack.
  3. Differentiate axios errors (axios.isAxiosError) to surface status/body.
  4. Handle known recoverable errors (timeout, 429) with retry instead of throw.

Example fix

// before
} catch (error: any) {
    throw new Error(error.message)
}

// after
} catch (error: any) {
    if (error instanceof Error) throw error
    throw new Error(String(error))
}
Defensive patterns

Strategy: try-catch

Try / catch

} catch (error: any) {
    // preserve the original — do NOT flatten to new Error(error.message)
    if (error instanceof Error) throw error
    throw new Error(String(error))
}

Prevention

When it happens

Trigger: Any exception during scrapeUrl: network timeout, DNS failure, non-200 handled by handleError (which itself throws), or the inner 'Failed to scrape URL' throw being re-caught here.

Common situations: Intermittent network issues, Spider 5xx responses, or the inner throw cascading through this outer catch and losing detail.

Related errors


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