{"record":{"id":"a933778672b9ba0f","repo":"n8n-io/n8n","slug":"error-message-a93377","errorCode":null,"errorMessage":"${error.message}","messagePattern":"\\$\\{error\\.message\\}","errorType":"exception","errorClass":"NodeOperationError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/nodes-langchain/nodes/vendors/GoogleGemini/actions/router.ts","lineNumber":64,"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":46,"sourceCodeEnd":73,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/vendors/GoogleGemini/actions/router.ts#L46-L73","documentation":"Catch-all in the Google Gemini router's per-item execution loop. When the dispatched operation (execute.call(this, i)) throws and the node is NOT in continueOnFail mode, the original error is re-wrapped as a NodeOperationError carrying the itemIndex and the original description. The message is the wrapped error's own message.","triggerScenarios":"Any inner operation throws (model validation, API HTTP error, upload failure, malformed response) on item i, and the workflow/execution settings do not have 'Continue On Fail' enabled. The original error type and description are preserved on the wrapped error.","commonSituations":"One item in a batch has a bad prompt / model / binary while others are fine; the upstream API rate-limits or returns 4xx for one request; a credential is expired so every item fails on the first one.","solutions":["Read the wrapped error's message/description — it identifies the real underlying failure (model not supported, upload failed, non-empty prompt, etc.) — and fix that root cause using its own guidance.","If you want the loop to keep processing the remaining items, enable the node's 'Continue On Fail' setting (or set the workflow execution to continue on fail); failures are then pushed as { json: { error } } instead of thrown.","For batch robustness, split the input so one bad item doesn't abort the whole run, or pre-validate each item upstream."],"exampleFix":"// before — one bad item aborts the whole loop\n// (continueOnFail off)\n\n// after — toggle on the node so failures are captured per item\n// In the node settings: Settings → 'Continue On Fail' = true","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const out = await geminiNode.execute();\n} catch (e) {\n  // NodeOperationError carries itemIndex on the failing item\n  const itemIndex = (e as NodeOperationError).itemIndex;\n  if (itemIndex != null) {\n    // isolate the bad item, continue with the rest\n  }\n  throw e;\n}","preventionTips":["Enable 'Continue On Fail' on the Gemini node so one bad item doesn't abort the batch — failures surface as { json: { error } } rows.","Pre-validate each item's prompt/model/binary upstream so inner operations rarely throw.","Run with a small batch first to catch per-item issues before scaling up."],"tags":["google-gemini","router","error-wrapper","continue-on-fail","batch","node-operation-error"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}