{"record":{"id":"1e2a921f9ab285b3","repo":"GraphiteEditor/Graphite","slug":"node","errorCode":null,"errorMessage":"Node","messagePattern":"Node","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"editor/src/messages/portfolio/document/graph_operation/utility_types.rs","lineNumber":73,"sourceCode":"\t\tif layer == LayerNodeIdentifier::ROOT_PARENT {\n\t\t\tlog::error!(\"LayerNodeIdentifier::ROOT_PARENT should not be used in ModifyInputsContext::new_with_layer\");\n\t\t\treturn None;\n\t\t}\n\t\tlet mut document = Self::new(network_interface, responses);\n\t\tdocument.layer_node = Some(layer);\n\t\tSome(document)\n\t}\n\n\t/// Creates a new layer and adds it to the document network. network_interface.move_layer_to_stack should be called after\n\tpub fn create_layer(&mut self, new_id: NodeId) -> LayerNodeIdentifier {\n\t\tlet new_merge_node = resolve_network_node_type(\"Merge\").expect(\"Merge node\").default_node_template();\n\t\tself.network_interface.insert_node(new_id, new_merge_node, &[]);\n\t\tLayerNodeIdentifier::new(new_id, self.network_interface)\n\t}\n\n\t/// Creates an artboard as the primary export for the document network.\n\tpub fn create_artboard(&mut self, new_id: NodeId, location: DVec2, dimensions: DVec2, background: Color, clip: bool) -> LayerNodeIdentifier {\n\t\tlet artboard_node_template = resolve_network_node_type(\"Artboard\").expect(\"Node\").node_template_input_override([\n\t\t\tSome(NodeInput::type_default(list!(Artboard), true)),\n\t\t\tSome(NodeInput::type_default(list!(Graphic), true)),\n\t\t\tSome(NodeInput::value(TaggedValue::DVec2(location), false)),\n\t\t\tSome(NodeInput::value(TaggedValue::DVec2(dimensions), false)),\n\t\t\tSome(NodeInput::value(TaggedValue::Color(background), false)),\n\t\t\tSome(NodeInput::value(TaggedValue::Bool(clip), false)),\n\t\t]);\n\t\tself.network_interface.insert_node(new_id, artboard_node_template, &[]);\n\t\tLayerNodeIdentifier::new(new_id, self.network_interface)\n\t}\n\n\tpub fn insert_boolean_data(&mut self, operation: graphene_std::vector::misc::BooleanOperation, layer: LayerNodeIdentifier) {\n\t\tlet boolean = resolve_proto_node_type(graphene_std::path_bool_nodes::boolean_operation::IDENTIFIER)\n\t\t\t.expect(\"Boolean node does not exist\")\n\t\t\t.node_template_input_override([\n\t\t\t\tSome(NodeInput::type_default(list!(Graphic), true)),\n\t\t\t\tSome(NodeInput::value(TaggedValue::BooleanOperation(operation), false)),\n\t\t\t]);","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/GraphiteEditor/Graphite/blob/c507b356453361e31638b8bff8f6d46b6da2961e/editor/src/messages/portfolio/document/graph_operation/utility_types.rs#L55-L91","documentation":"Panics when `resolve_network_node_type(\"Artboard\")` returns `None` in `create_artboard`. The Artboard network-node definition must exist in the static `DOCUMENT_NODE_TYPES` registry under the exact key `\"Artboard\"`; `create_artboard` then overrides its template inputs (Artboard/Graphic types, location, dimensions, background, clip). The bare `expect(\"Node\")` is a registry-presence assertion for that key.","triggerScenarios":"Creating an artboard via `GraphOperationMessage` (artboard tool, document setup for a new file, import flows). Fires only when the `\"Artboard\"` key is missing from the registry — renamed key, deleted definition, or a registry-generating macro that skipped it.","commonSituations":"Renaming the Artboard registry key during a definitions refactor; a rebase that dropped the definition entry; conditionally-compiled definitions where the artboard entry sits behind a disabled feature.","solutions":["Confirm the `\"Artboard\"` key exists in `DOCUMENT_NODE_TYPES`; re-add the `DocumentNodeDefinition` if a refactor removed it.","If renamed, update the key here or leave an alias so `resolve_network_node_type(\"Artboard\")` keeps resolving.","Handle the `None` case: log `\"Artboard node definition missing\"` and return without inserting a malformed node.","Improve the message from `\"Node\"` to something diagnosable (`\"Artboard node definition not registered\"`)."],"exampleFix":"// before\nlet artboard_node_template = resolve_network_node_type(\"Artboard\").expect(\"Node\").node_template_input_override([\n\n// after\nlet Some(artboard_def) = resolve_network_node_type(\"Artboard\") else {\n    log::error!(\"Artboard node definition not registered; cannot create artboard\");\n    return LayerNodeIdentifier::ROOT_PARENT;\n};\nlet artboard_node_template = artboard_def.node_template_input_override([","handlingStrategy":"validation","validationCode":"// Before calling create_artboard:\nif document_node_definitions::resolve_network_node_type(\"Artboard\").is_none() {\n    log::error!(\"Artboard node definition missing; aborting\");\n    return;\n}","typeGuard":"fn artboard_definition_available() -> bool {\n    document_node_definitions::resolve_network_node_type(\"Artboard\").is_some()\n}","tryCatchPattern":"// Rust has no try/catch; branch on the Option:\nlet Some(artboard_def) = resolve_network_node_type(\"Artboard\") else {\n    log::error!(\"Artboard definition missing\");\n    return LayerNodeIdentifier::ROOT_PARENT;\n};","preventionTips":["Include the Artboard string key in registry smoke tests","Improve expect messages beyond \"Node\" so crashes are diagnosable","Keep definition keys stable or aliased when renaming nodes","Run artboard creation flows after touching document_node_definitions.rs"],"tags":["rust","panic","expect","node-registry","string-lookup","artboard","graphite"],"backgroundTag":"node-definition-not-found","analyzedSha":"c507b356453361e31638b8bff8f6d46b6da2961e","analyzedAt":"2026-08-16T21:57:18.596Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}