Repository navigation
fix(ten_rust): return an error from GraphLoc::check_node_exists for a location with no node - #2348
Open
RaphaelFakhri wants to merge 1 commit into
Conversation
… location with no node A GraphLoc with no extension, subgraph or selector made check_node_exists panic through unwrap, which crashed the tman designer server when a connection was added without a selected node. Propagate the error instead.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GraphLoc::check_node_existscalledunwrap()onget_node_name()andget_node_type(). Both return an error when the location has no extension, subgraph or selector. In the tman designer, adding a connection without selecting a node reaches this function and the server panics withthe type of the node must be one of extension/subgraph/selector.The function returns
Result, so this change propagates the error with?. The API caller receives an error instead of a crashed worker.Fixes #1877
Test
Adds
graph::locto theten_rustintegration tests. It callscheck_node_existson an emptyGraphLocand asserts the returned error message.src/graph/connection/mod.rs:170with the message from the issue.graph::tests still pass.