{"record":{"id":"898956bfb4291065","repo":"n8n-io/n8n","slug":"error-message-898956","errorCode":null,"errorMessage":"${error.message}","messagePattern":"\\$\\{error\\.message\\}","errorType":"exception","errorClass":"NodeOperationError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/nodes-langchain/nodes/vendors/MiniMax/actions/router.ts","lineNumber":49,"sourceCode":"\t\t\tbreak;\n\t\tcase 'video':\n\t\t\texecute = video[miniMaxTypeData.operation].execute;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow new NodeOperationError(this.getNode(), `The resource \"${resource}\" is not supported!`);\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":31,"sourceCodeEnd":58,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/vendors/MiniMax/actions/router.ts#L31-L58","documentation":"Per-item catch in the MiniMax router's execute loop. When continueOnFail is disabled (the default for batch items), any error thrown by the selected operation's execute callback is re-thrown as a NodeOperationError annotated with the itemIndex and the original error's description. The original message is preserved as the NodeOperationError message.","triggerScenarios":"Any underlying operation (TTS, image generation, video generation, text) threw for item i. With continueOnFail off, the router stops the whole execution and surfaces the per-item error; with continueOnFail on, the error is captured into the item's JSON output and processing continues.","commonSituations":"One bad input item in a batch aborts the run; continueOnFail not enabled when partial success is desired; underlying API error (see errors 862–865, 868–875) propagated through the router.","solutions":["Read error.message — it is the underlying operation's message (e.g. a MiniMax API failure).","Enable 'Continue On Fail' on the node if you want the batch to keep processing past the failing item.","Inspect the item at error.itemIndex and fix or remove it.","Address the root cause named in the underlying operation's error."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Pre-validate each item's required parameters for the chosen operation before the loop,\n// so per-item failures are caught as data errors rather than runtime throws.\nfunction validateItemForOperation(item: INodeExecutionData, resource: string, operation: string): string | null {\n  if (!item || typeof item !== 'object') return 'item is missing';\n  if (resource === 'audio' && operation === 'transcribe' && !item.json?.audioUrl) {\n    return 'audio.transcribe requires item.json.audioUrl';\n  }\n  // extend per operation\n  return null;\n}","typeGuard":"function isItemIndexError(e: unknown): e is NodeOperationError & { itemIndex: number } {\n  return e instanceof NodeOperationError && typeof (e as { itemIndex?: number }).itemIndex === 'number';\n}","tryCatchPattern":"for (let i = 0; i < items.length; i++) {\n  try {\n    const responseData = await execute.call(this, i);\n    returnData.push(...responseData);\n  } catch (error) {\n    if (this.continueOnFail()) {\n      returnData.push({ json: { error: (error as Error).message }, pairedItem: { item: i } });\n      continue;\n    }\n    throw new NodeOperationError(this.getNode(), error, { itemIndex: i });\n  }\n}","preventionTips":["Enable 'Continue On Fail' on the node when running batches where some items may be invalid.","Pre-validate each item's required parameters for the chosen operation before the execute loop.","Log the failing itemIndex so retries can target the specific item.","Address the root-cause operation error rather than catching at the router level."],"tags":["minimax","router","item-error","continue-on-fail"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}