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.
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 theNodeLike
methods that can fail toResult<T, GraphEvalError>
for the relevant typeT
. The errors can then propagate up the graph and the editor will report it.