{"record":{"id":"be75b9940192df89","repo":"ssssssss-team/spider-flow","slug":"e-message-for-child-nodename","errorCode":null,"errorMessage":"\" + e.message + \" for \" + child.nodeName","messagePattern":"\" \\+ e\\.message \\+ \" for \" \\+ child\\.nodeName","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"spider-flow-web/src/main/resources/static/js/mxgraph/mxgraph.js","lineNumber":87859,"sourceCode":"\t\t\tvalue = child.getAttribute('value');\r\n\t\t\t\r\n\t\t\tif (value == null && mxObjectCodec.allowEval)\r\n\t\t\t{\r\n\t\t\t\tvalue = mxUtils.eval(mxUtils.getTextContent(child));\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tvalue = dec.decode(child, template);\r\n\t\t}\r\n\r\n\t\ttry\r\n\t\t{\r\n\t\t\tthis.addObjectValue(obj, fieldname, value, template);\r\n\t\t}\r\n\t\tcatch (e)\r\n\t\t{\r\n\t\t\tthrow new Error(e.message + ' for ' + child.nodeName);\r\n\t\t}\r\n\t}\r\n};\r\n\r\n/**\r\n * Function: getFieldTemplate\r\n * \r\n * Returns the template instance for the given field. This returns the\r\n * value of the field, null if the value is an array or an empty collection\r\n * if the value is a collection. The value is then used to populate the\r\n * field for a new instance. For strongly typed languages it may be\r\n * required to override this to return the correct collection instance\r\n * based on the encoded child.\r\n */\t\r\nmxObjectCodec.prototype.getFieldTemplate = function(obj, fieldname, child)\r\n{\r\n\tvar template = obj[fieldname];\r\n\t\r","sourceCodeStart":87841,"sourceCodeEnd":87877,"githubUrl":"https://github.com/ssssssss-team/spider-flow/blob/c799cca99c7d064673dc79e6ef06a08bbc0e292d/spider-flow-web/src/main/resources/static/js/mxgraph/mxgraph.js#L87841-L87877","documentation":"During XML decoding, mxGraph's codec wraps failures from addObjectValue (e.g. setting a field on the decoded object) and rethrows them as Error(e.message + ' for ' + child.nodeName), annotating which XML child element caused the failure. It is an error-context wrapper, not a distinct failure mode.","triggerScenarios":"Decoding graph XML where a child element maps to a field whose value cannot be applied (wrong value type for the field, unknown enum/number string, codec for the child's type throwing internally).","commonSituations":"Hand-edited or version-mismatched graph XML (attribute written for an older/newer mxGraph schema), corrupt saved diagrams, custom codecs that throw on unexpected values.","solutions":["Read the wrapped e.message to identify the field, then fix the offending XML child element's value/format.","Regenerate or re-save the diagram with a compatible mxGraph version.","Add/repair a codec mapping (mxCodecRegistry) if a custom class or field changed name."],"exampleFix":"// before (XML)\n<mxGeometry width=\"abc\" .../>\n// after\n<mxGeometry width=\"120\" .../>","handlingStrategy":"try-catch","validationCode":"// Validate XML values before decode: ensure numeric fields parse and known fields match the mxGraph schema version\nArray.prototype.forEach.call(doc.querySelectorAll('[width],[height],[x],[y]'), function(el){ ['width','height','x','y'].forEach(function(a){ var v = el.getAttribute(a); if (v !== '' && isNaN(Number(v))) throw new Error('Bad numeric attribute ' + a + '=' + v); }); });","typeGuard":null,"tryCatchPattern":"try {\n  obj = codec.decode(node);\n} catch (e) {\n  // e.message ends with ' for <nodeName>' identifying the failing XML element\n  console.error('Decode failed at element:', e.message.split(' for ').pop(), e.message);\n  throw e;\n}","preventionTips":["Parse the trailing 'for <nodeName>' to locate the failing element quickly.","Keep the mxGraph version that wrote the XML consistent with the one decoding it.","Validate saved diagram XML against the schema before loading."],"tags":["mxgraph","xml-decode","codec"],"backgroundTag":"unexpected-api-response-shape","analyzedSha":"c799cca99c7d064673dc79e6ef06a08bbc0e292d","analyzedAt":"2026-09-08T13:47:08.225Z","contentChangedAt":"2026-09-08T13:47:08.225Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}