{"record":{"id":"ad8c4babcb498927","repo":"FlowiseAI/Flowise","slug":"errormessage","errorCode":null,"errorMessage":"${errorMessage}","messagePattern":"\\$\\{errorMessage\\}","errorType":"http","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/agentflow/HTTP/HTTP.ts","lineNumber":375,"sourceCode":"                        responseType\n                    }\n                },\n                error: {\n                    name: error.name || 'Error',\n                    message: errorMessage\n                },\n                state\n            }\n\n            // Add more error details if available\n            if (error.response) {\n                errorResponse.error.status = error.response.status\n                errorResponse.error.statusText = error.response.statusText\n                errorResponse.error.data = error.response.data\n                errorResponse.error.headers = error.response.headers\n            }\n\n            throw new Error(errorMessage)\n        }\n    }\n}\n\nmodule.exports = { nodeClass: HTTP_Agentflow }\n","sourceCodeStart":357,"sourceCodeEnd":381,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/agentflow/HTTP/HTTP.ts#L357-L381","documentation":"Thrown from HTTP_Agentflow.run()'s catch block when an HTTP request inside an agentflow fails. Unlike error 20, the message is normalized: `errorMessage` is derived from `error.response?.data?.message || error.response?.data?.error || error.message || 'An error occurred during the HTTP request'`. The built errorResponse (with status/headers/data) is logged but not surfaced — only the string message is re-thrown, so callers lose the HTTP status code.","triggerScenarios":"The fetch/axios call returns non-2xx (response.data present), the request never reaches the server (network/DNS failure, so error.response is undefined and error.message is used), or the request throws before sending (invalid URL, SSL error).","commonSituations":"Wrong base URL or path; missing/incorrect auth header causing 401/403; target API down or rate-limiting (429); self-signed cert in dev; typo in JSON body causing a 400.","solutions":["Check server logs for the `HTTP Request Error:` line which has the full error including response body.","Verify method, URL, headers, and body in the node inputs; test the same call with curl/Postman.","If status is 401/403, fix the credential/header; if 429, add backoff; if 5xx, check the upstream service.","If no response object, investigate network: DNS, proxy, TLS, firewall.","Patch the throw to include the status code in the message so callers can branch on it."],"exampleFix":"// before\n            throw new Error(errorMessage)\n// after\n            const status = error.response?.status\n            const err = new Error(status ? `HTTP ${status}: ${errorMessage}` : errorMessage)\n            ;(err as any).status = status\n            throw err","handlingStrategy":"validation","validationCode":"// Before invoking HTTP_Agentflow, validate the request shape\nconst url = nodeData.inputs?.httpUrl\ntry { new URL(url) } catch { throw new Error(`Invalid HTTP url: ${url}`) }\nif (!nodeData.inputs?.httpMethod) throw new Error('HTTP method is required')","typeGuard":"const isAxiosLikeError = (e: unknown): e is { response?: { status: number; data: any } } =>\n  typeof e === 'object' && e !== null && 'response' in e","tryCatchPattern":"try {\n  const out = await httpNode.run(nodeData, input, options)\n} catch (e) {\n  const msg = (e as Error).message\n  if (/^(401|403)/.test(msg)) handleAuth()\n  else if (/^429/.test(msg)) backoff()\n  else throw e\n}","preventionTips":["Validate URL with `new URL()` before binding it to the node.","Provide auth headers/credentials for endpoints that require them.","Use responseType that matches the API (json vs text) to avoid parse failures.","Test the endpoint with curl before wiring it into the flow."],"tags":["agentflow","http","network","error-wrapping"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}