mbrea-c / bevy_animation_graph

Animation graphs in Bevy!
Apache License 2.0
97 stars 5 forks source link

Error handling during graph evaluation #22

Closed mbrea-c closed 7 months ago

mbrea-c commented 8 months ago

Currently error handling is close to non-existent: We panic when something goes wrong during graph evaluation (i.e. a parameter we expect to be present is disconnected). This was (somewhat) fine for use as a library but it severely falls short when working on the upcoming graphical editor.

If there is an error on the graph, we want the editor to report the error and let the user resolve it, not to crash.

We can probably introduce some graph evaluation error type (e.g. GraphEvalError), and change return types of the NodeLike methods that can fail to Result<T, GraphEvalError> for the relevant type T. The errors can then propagate up the graph and the editor will report it.

mbrea-c commented 7 months ago

Closed by #26