GraphiteEditor/Graphite · critical

Circle can't be found

Error message

Circle can't be found

What it means

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.

Source

Thrown at editor/src/messages/tool/common_functionality/shapes/circle_shape.rs:84

	fn cleanup(&mut self) {
		self.circle_radius_handle.cleanup();
	}

	fn mouse_cursor_icon(&self) -> Option<MouseCursorIcon> {
		if self.circle_radius_handle.hovered() || self.circle_radius_handle.is_dragging() {
			return Some(MouseCursorIcon::EWResize);
		}

		None
	}
}

#[derive(Default)]
pub struct Circle;

impl Circle {
	pub fn create_node() -> NodeTemplate {
		let node_type = resolve_proto_node_type(graphene_std::vector::generator_nodes::circle::IDENTIFIER).expect("Circle can't be found");
		node_type.node_template_input_override([None, Some(NodeInput::value(TaggedValue::F64(0.), false))])
	}

	pub fn update_shape(
		document: &DocumentMessageHandler,
		ipp: &InputPreprocessorMessageHandler,
		viewport: &ViewportMessageHandler,
		layer: LayerNodeIdentifier,
		shape_tool_data: &mut ShapeToolData,
		modifier: ShapeToolModifierKey,
		responses: &mut VecDeque<Message>,
	) {
		let center = modifier[0];
		let [start, end] = shape_tool_data.data.calculate_circle_points(document, ipp, viewport, center);
		let Some(node_id) = graph_modification_utils::get_circle_id(layer, &document.network_interface) else {
			return;
		};

View on GitHub (pinned to c507b35645)

Solutions

  1. Check that the circle identifier is registered: resolve_proto_node_type(...).is_some() in a test or debug print
  2. Fix const/registration mismatch and rebuild
  3. Use let-else to degrade gracefully instead of panicking the tool
  4. Guard the whole family with one registry-drift test covering all shape tools

Example fix

// before
let node_type = resolve_proto_node_type(graphene_std::vector::generator_nodes::circle::IDENTIFIER).expect("Circle can't be found");
// after
let node_type = resolve_proto_node_type(graphene_std::vector::generator_nodes::circle::IDENTIFIER)
	.expect("Circle definition missing from DOCUMENT_NODE_TYPES — check generator_nodes registration");
Defensive patterns

Strategy: validation

Validate before calling

assert!(
	document_node_definitions::resolve_proto_node_type(graphene_std::vector::generator_nodes::circle::IDENTIFIER).is_some(),
	"Circle generator not registered"
);

Prevention

When it happens

Trigger: 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).

Common situations: Node renames during graph refactors; feature-flag builds without the circle generator; upgrades that relocate the node from proto to network definition.

Related errors


AI-assisted analysis of GraphiteEditor/Graphite@c507b35645 (2026-08-16). Data as JSON: /api/errors/3f39b19c424bbe1d. Report an issue: GitHub.