{"record":{"id":"60b2f23fd0c8a12d","repo":"FlowiseAI/Flowise","slug":"http-error-res-status-res-statustext-60b2f2","errorCode":null,"errorMessage":"HTTP Error ${res.status}: ${res.statusText}","messagePattern":"HTTP Error (.+?): (.+?)","errorType":"http","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/tools/RequestsPost/core.ts","lineNumber":137,"sourceCode":"                    ...inputBody,\n                    ...params.body\n                }\n            }\n\n            const requestHeaders = {\n                'Content-Type': 'application/json',\n                ...(params.headers || {}),\n                ...this.headers\n            }\n\n            const res = await secureFetch(inputUrl, {\n                method: 'POST',\n                headers: requestHeaders,\n                body: JSON.stringify(inputBody)\n            })\n\n            if (!res.ok) {\n                throw new Error(`HTTP Error ${res.status}: ${res.statusText}`)\n            }\n\n            const text = await res.text()\n            return text.slice(0, this.maxOutputLength)\n        } catch (error) {\n            throw new Error(`Failed to make POST request: ${error instanceof Error ? error.message : 'Unknown error'}`)\n        }\n    }\n}\n","sourceCodeStart":119,"sourceCodeEnd":147,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/tools/RequestsPost/core.ts#L119-L147","documentation":"Thrown inside the try block of RequestsPost_Core._call when secureFetch returns a non-ok response. Reports status code and status text. Like 481, this throw is always re-caught by the surrounding catch (485) and re-wrapped as 'Failed to make POST request: HTTP Error <status>: <text>'.","triggerScenarios":"Server rejects the POST: 400 bad body, 401/403 auth, 404 wrong path, 409 conflict, 422 validation error, 5xx server fault, 429 rate limit.","commonSituations":"JSON body schema mismatch with the API; missing Content-Type or auth header; wrong endpoint; upstream service degraded; payload exceeds server limits.","solutions":["Read the wrapped message suffix to get the real status code, then act on it.","For 400/422, verify the body shape matches the API contract.","For 401/403, provide correct credentials in `headers`.","For 429/5xx, retry with backoff from the caller."],"exampleFix":"// before\nif (!res.ok) throw new Error(`HTTP Error ${res.status}: ${res.statusText}`)\n\n// after (include response body for debuggability)\nif (!res.ok) {\n  const detail = await res.text().catch(() => '')\n  throw new Error(`POST ${inputUrl} failed: ${res.status} ${res.statusText} — ${detail.slice(0, 500)}`)\n}","handlingStrategy":"retry","validationCode":"async function safePost(tool: any, arg: any, maxRetries = 3) {\n  for (let attempt = 0; attempt <= maxRetries; attempt++) {\n    try { return await tool._call(arg) }\n    catch (e) {\n      const m = (e as Error).message.match(/HTTP Error (\\d{3})/)\n      const code = m ? Number(m[1]) : 0\n      const transient = code === 429 || (code >= 500 && code < 600)\n      if (!transient || attempt === maxRetries) throw e\n      await new Promise((r) => setTimeout(r, 2 ** attempt * 500))\n    }\n  }\n}","typeGuard":"const isClientError = (e: unknown): boolean => {\n  const m = (e instanceof Error ? e.message : String(e)).match(/HTTP Error (\\d{3})/)\n  return !!m && Number(m[1]) >= 400 && Number(m[1]) < 500 && Number(m[1]) !== 429\n}","tryCatchPattern":"try { return await tool._call(arg) }\ncatch (e) {\n  const code = ((e as Error).message.match(/HTTP Error (\\d{3})/) || [])[1]\n  if (code === '400' || code === '422') throw new Error('POST body rejected by server — check schema')\n  if (code === '409') throw new Error('Conflict — resource state changed')\n  throw e\n}","preventionTips":["Validate the POST body against the API's expected schema before sending.","Retry only 429 and 5xx; do not retry 4xx body/auth errors.","Log status + response body for fast root-cause on 4xx."],"tags":["http","network","server-error","post","status-code"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}