{"record":{"id":"aff42234d2dbc57c","repo":"n8n-io/n8n","slug":"error-message-aff422","errorCode":null,"errorMessage":"${error.message}","messagePattern":"\\$\\{error\\.message\\}","errorType":"exception","errorClass":"NodeOperationError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/nodes-langchain/nodes/vendors/Anthropic/actions/router.ts","lineNumber":56,"sourceCode":"\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tthis.getNode(),\n\t\t\t\t`The operation \"${operation}\" is not supported!`,\n\t\t\t);\n\t}\n\n\tfor (let i = 0; i < items.length; i++) {\n\t\ttry {\n\t\t\tconst responseData = await execute.call(this, i);\n\t\t\treturnData.push(...responseData);\n\t\t} catch (error) {\n\t\t\tif (this.continueOnFail()) {\n\t\t\t\treturnData.push({ json: { error: error.message }, pairedItem: { item: i } });\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tthrow new NodeOperationError(this.getNode(), error, {\n\t\t\t\titemIndex: i,\n\t\t\t\tdescription: error.description,\n\t\t\t});\n\t\t}\n\t}\n\n\treturn [returnData];\n}\n","sourceCodeStart":38,"sourceCodeEnd":65,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/vendors/Anthropic/actions/router.ts#L38-L65","documentation":"Thrown by the Anthropic router's item-processing loop when an inner execute function throws and 'Continue On Fail' is NOT enabled. The caught error is re-wrapped as a NodeOperationError with the current itemIndex and error.description (if present). Note: if the caught error is not a standard Error with a .message property, accessing error.message may itself fail or yield undefined, since the catch is untyped.","triggerScenarios":"Any error thrown during the actual operation execution for a specific input item when Continue On Fail is disabled. The original error is caught at router.ts:50 and re-thrown at line 56. Common sources include API errors from Anthropic (rate limits, invalid model, content policy), input validation failures from the operation modules, or binary data access errors.","commonSituations":"Anthropic API rate limit (429); invalid model ID; message content triggers safety filter; binary attachment too large or wrong format; API key expired or lacking permissions; prompt exceeds token limits.","solutions":["Read the wrapped error.message — it contains the original error's message which identifies the root cause.","Fix the root cause: update credentials, reduce prompt length, fix the input data for the failing item index, or select a valid model.","Enable 'Continue On Fail' in the node's Settings tab if you need the workflow to proceed past the failing item.","Check the execution detail for the specific itemIndex to see which input item triggered the failure."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  // ... Anthropic node execution logic ...\n} catch (error) {\n  if (error instanceof NodeOperationError && error.itemIndex !== undefined) {\n    console.error(`Item ${error.itemIndex} failed: ${error.message}`);\n    // route to error handling, retry, or skip\n  }\n  throw error;\n}","preventionTips":["Enable 'Continue On Fail' in the node's Settings tab to capture per-item errors without halting.","Validate credentials, model IDs, and input data upstream before reaching the Anthropic node.","Use n8n's Error Trigger workflow to handle failures in a dedicated error-handling branch.","Keep prompts within the model's token limits to avoid token-related API errors."],"tags":["error-wrapping","router","anthropic","runtime"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}