{"record":{"id":"e9a38b8c6dde9935","repo":"FlowiseAI/Flowise","slug":"oxylabs-failed-to-call-oxylabs-api-response-st","errorCode":null,"errorMessage":"Oxylabs: Failed to call Oxylabs API: ${response.status}","messagePattern":"Oxylabs: Failed to call Oxylabs API: (.+?)","errorType":"http","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/documentloaders/Oxylabs/Oxylabs.ts","lineNumber":91,"sourceCode":"        super()\n        this.params = loaderParams\n    }\n\n    private async sendAPIRequest<R>(params: any): Promise<AxiosResponse<R, any>> {\n        params = Object.fromEntries(Object.entries(params).filter(([_, value]) => value !== null && value !== '' && value !== undefined))\n\n        const auth = Buffer.from(`${this.params.username}:${this.params.password}`).toString('base64')\n\n        const response = await axios.post<R>('https://realtime.oxylabs.io/v1/queries', params, {\n            headers: {\n                'Content-Type': 'application/json',\n                'x-oxylabs-sdk': 'oxylabs-integration-flowise/1.0.0 (1.0.0; 64bit)',\n                Authorization: `Basic ${auth}`\n            }\n        })\n\n        if (response.status >= 400) {\n            throw new Error(`Oxylabs: Failed to call Oxylabs API: ${response.status}`)\n        }\n\n        return response\n    }\n\n    public async load(): Promise<DocumentInterface[]> {\n        let isUrlSource = this.params.source == 'universal'\n\n        const params = {\n            source: this.params.source,\n            geo_location: this.params.geo_location,\n            render: this.params.render ? 'html' : null,\n            parse: this.params.parse,\n            user_agent_type: this.params.user_agent_type,\n            markdown: !this.params.parse,\n            url: isUrlSource ? this.params.query : null,\n            query: !isUrlSource ? this.params.query : null\n        }","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/documentloaders/Oxylabs/Oxylabs.ts#L73-L109","documentation":"Thrown by OxylabsLoader.sendAPIRequest when the axios POST to https://realtime.oxylabs.io/v1/queries returns a status >= 400. IMPORTANT caveat: axios's default validateStatus rejects for statuses outside 2xx-399, so with default config axios itself throws an AxiosError BEFORE this branch runs — making this message effectively dead code unless a custom validateStatus or a 3xx-with-error body is in play. The error you normally see is an AxiosError (ECONN*, 401, 402, etc.).","triggerScenarios":"401/403 when the Oxylabs username/password (Basic auth) are wrong; 400 when params are malformed or source/geo_location invalid; 402/429 when account credits are exhausted or rate limits hit; network errors throw as AxiosError before reaching the check.","commonSituations":"Credential fields username/password swapped or not set; source value not matching a valid Oxylabs source (e.g. 'google' vs 'google_search'); geo_location code invalid; subscription out of credits.","solutions":["Verify the Oxylabs credential username and password are correct (test with curl -u user:pass).","Confirm the source and geo_location values are valid for your Oxylabs plan.","Check account credits/balance in the Oxylabs dashboard for 402/429.","Note: with default axios config you will get an AxiosError, not this message — wrap the call and inspect err.response?.status from the AxiosError.","Set a custom validateStatus only if you intentionally want to handle >= 400 in this branch."],"exampleFix":"// before - branch unreachable with default axios\nif (response.status >= 400) {\n  throw new Error(`Oxylabs: Failed to call Oxylabs API: ${response.status}`)\n}\n// after - handle the AxiosError that axios actually throws, with body detail\n} catch (err) {\n  if (axios.isAxiosError(err) && err.response) {\n    throw new Error(`Oxylabs API ${err.response.status}: ${JSON.stringify(err.response.data)}`)\n  }\n  throw err\n}","handlingStrategy":"try-catch","validationCode":"// Validate credentials and params shape before sending\nfunction validateOxylabsParams(p) {\n  if (!p.username || !p.password) throw new Error('Oxylabs username and password are required')\n  if (!p.source) throw new Error('Oxylabs source is required')\n  if (p.source === 'universal' && !p.query) throw new Error('query (URL) required for universal source')\n}","typeGuard":"import axios from 'axios'\nfunction isAxiosError(e) { return axios.isAxiosError(e) }","tryCatchPattern":"try {\n  return await oxylabsLoader.load()\n} catch (err) {\n  if (axios.isAxiosError(err) && err.response) {\n    throw new Error(`Oxylabs API ${err.response.status}: ${JSON.stringify(err.response.data)}`, { cause: err })\n  }\n  throw err\n}","preventionTips":["Verify Oxylabs username/password with a curl -u test.","Confirm source and geo_location are valid for your plan.","Monitor account credits to avoid 402/429.","Handle the AxiosError (not the >= 400 branch) since axios rejects first by default."],"tags":["oxylabs","http","axios","api-status","auth","dead-code"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}