diff --git a/editor/src/messages/portfolio/portfolio_message_handler.rs b/editor/src/messages/portfolio/portfolio_message_handler.rs index 433862db..2d52e282 100644 --- a/editor/src/messages/portfolio/portfolio_message_handler.rs +++ b/editor/src/messages/portfolio/portfolio_message_handler.rs @@ -634,6 +634,17 @@ impl PortfolioMessageHandler { self.executor.poll_node_graph_evaluation(active_document, responses).unwrap_or_else(|e| { log::error!("Error while evaluating node graph: {e}"); + + let error = r#" + + + The document cannot be rendered in its current state. + Check for error details in the node graph, which can be + opened with the viewport's top right Node Graph button. + /text>"# + // It's a mystery why the `/text>` tag above needs to be missing its `<`, but when it exists it prints the `<` character in the text. However this works with it removed. + .to_string(); + responses.add(FrontendMessage::UpdateDocumentArtwork { svg: error }); }); } } diff --git a/editor/src/node_graph_executor.rs b/editor/src/node_graph_executor.rs index 254d220b..3241f4f0 100644 --- a/editor/src/node_graph_executor.rs +++ b/editor/src/node_graph_executor.rs @@ -558,7 +558,12 @@ impl NodeGraphExecutor { responses.add(BroadcastEvent::DocumentIsDirty); responses.add(OverlaysMessage::Draw); - let node_graph_output = result.map_err(|e| format!("Node graph evaluation failed: {e:?}"))?; + let Ok(node_graph_output) = result else { + // Clear the click targets while the graph is in an un-renderable state + document.metadata.update_click_targets(HashMap::new()); + + return Err("Node graph evaluation failed".to_string()); + }; document.metadata.update_transforms(new_upstream_transforms); document.metadata.update_click_targets(new_click_targets);