{"record":{"id":"3f39b19c424bbe1d","repo":"GraphiteEditor/Graphite","slug":"circle-can-t-be-found","errorCode":null,"errorMessage":"Circle can't be found","messagePattern":"Circle can't be found","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"editor/src/messages/tool/common_functionality/shapes/circle_shape.rs","lineNumber":84,"sourceCode":"\tfn cleanup(&mut self) {\n\t\tself.circle_radius_handle.cleanup();\n\t}\n\n\tfn mouse_cursor_icon(&self) -> Option<MouseCursorIcon> {\n\t\tif self.circle_radius_handle.hovered() || self.circle_radius_handle.is_dragging() {\n\t\t\treturn Some(MouseCursorIcon::EWResize);\n\t\t}\n\n\t\tNone\n\t}\n}\n\n#[derive(Default)]\npub struct Circle;\n\nimpl Circle {\n\tpub fn create_node() -> NodeTemplate {\n\t\tlet node_type = resolve_proto_node_type(graphene_std::vector::generator_nodes::circle::IDENTIFIER).expect(\"Circle can't be found\");\n\t\tnode_type.node_template_input_override([None, Some(NodeInput::value(TaggedValue::F64(0.), false))])\n\t}\n\n\tpub fn update_shape(\n\t\tdocument: &DocumentMessageHandler,\n\t\tipp: &InputPreprocessorMessageHandler,\n\t\tviewport: &ViewportMessageHandler,\n\t\tlayer: LayerNodeIdentifier,\n\t\tshape_tool_data: &mut ShapeToolData,\n\t\tmodifier: ShapeToolModifierKey,\n\t\tresponses: &mut VecDeque<Message>,\n\t) {\n\t\tlet center = modifier[0];\n\t\tlet [start, end] = shape_tool_data.data.calculate_circle_points(document, ipp, viewport, center);\n\t\tlet Some(node_id) = graph_modification_utils::get_circle_id(layer, &document.network_interface) else {\n\t\t\treturn;\n\t\t};\n","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/GraphiteEditor/Graphite/blob/c507b356453361e31638b8bff8f6d46b6da2961e/editor/src/messages/tool/common_functionality/shapes/circle_shape.rs#L66-L102","documentation":"Circle::create_node resolves the Circle generator node through resolve_proto_node_type(graphene_std::vector::generator_nodes::circle::IDENTIFIER).expect(\"Circle can't be found\") (circle_shape.rs:84). resolve_proto_node_type (document_node_definitions.rs:1480) is a plain lookup in the Lazy static DOCUMENT_NODE_TYPES HashMap, so the expect panics iff the Circle identifier is not among the registered definitions. This fires on the first circle-tool interaction after a registry/identifier drift.","triggerScenarios":"Starting to draw with the Circle tool when generator_nodes::circle::IDENTIFIER has no DOCUMENT_NODE_TYPES entry (renamed const, removed node, edited registration list).","commonSituations":"Node renames during graph refactors; feature-flag builds without the circle generator; upgrades that relocate the node from proto to network definition.","solutions":["Check that the circle identifier is registered: resolve_proto_node_type(...).is_some() in a test or debug print","Fix const/registration mismatch and rebuild","Use let-else to degrade gracefully instead of panicking the tool","Guard the whole family with one registry-drift test covering all shape tools"],"exampleFix":"// before\nlet node_type = resolve_proto_node_type(graphene_std::vector::generator_nodes::circle::IDENTIFIER).expect(\"Circle can't be found\");\n// after\nlet node_type = resolve_proto_node_type(graphene_std::vector::generator_nodes::circle::IDENTIFIER)\n\t.expect(\"Circle definition missing from DOCUMENT_NODE_TYPES — check generator_nodes registration\");","handlingStrategy":"validation","validationCode":"assert!(\n\tdocument_node_definitions::resolve_proto_node_type(graphene_std::vector::generator_nodes::circle::IDENTIFIER).is_some(),\n\t\"Circle generator not registered\"\n);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Grep the identifier string before renaming or deleting any generator node","Gate new tools on a registry check in debug builds (debug_assert!(resolve_...().is_some()))","Share one test enumerating all shape-tool identifiers to prevent piecemeal drift"],"tags":["rust","graphite","panic","expect","node-registry","circle-tool"],"backgroundTag":"node-definition-not-found","analyzedSha":"c507b356453361e31638b8bff8f6d46b6da2961e","analyzedAt":"2026-08-16T21:57:18.596Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}