{"record":{"id":"078a21a0bc2ff23a","repo":"FlowiseAI/Flowise","slug":"http-error-res-status-res-statustext-078a21","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/RequestsPut/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: 'PUT',\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 PUT 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/RequestsPut/core.ts#L119-L147","documentation":"Thrown inside RequestsPut_Core._call's try block when secureFetch returns a non-ok response. Reports status code and status text. As with 481/484, this is always re-caught by the outer catch (488) and observed as 'Failed to make PUT request: HTTP Error <status>: <text>'.","triggerScenarios":"Server rejects the PUT: 400 bad body, 401/403 auth, 404 resource missing, 405 method not allowed, 409 conflict, 413 payload too large, 5xx fault.","commonSituations":"PUT to a non-existent resource (404); idempotency/version conflict (409); missing auth; payload exceeds server limits; endpoint does not accept PUT.","solutions":["Recover the status code from the wrapped message suffix and act on it.","For 404, confirm the resource URL is correct before retrying.","For 401/403, supply correct credentials in `headers`.","For 409, re-fetch and reconcile state before retrying."],"exampleFix":"// before\nif (!res.ok) throw new Error(`HTTP Error ${res.status}: ${res.statusText}`)\n\n// after (include body for diagnosis)\nif (!res.ok) {\n  const detail = await res.text().catch(() => '')\n  throw new Error(`PUT ${inputUrl} failed: ${res.status} ${res.statusText} — ${detail.slice(0, 500)}`)\n}","handlingStrategy":"retry","validationCode":"async function safePut(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 === 409 || 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 isPutConflict = (e: unknown): boolean =>\n  /HTTP Error 409/.test(e instanceof Error ? e.message : String(e))","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 === '404') throw new Error('PUT target does not exist — verify resource URL')\n  if (code === '405') throw new Error('Endpoint does not accept PUT')\n  if (code === '409') { await refetchAndMerge(); return await tool._call(arg) }\n  throw e\n}","preventionTips":["Confirm the resource exists (GET) before PUT to avoid 404 loops.","Handle 409 conflicts by re-fetching state before retrying.","PUT is idempotent; safe to retry on 5xx."],"tags":["http","network","server-error","put","status-code"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}