Closed icidasset closed 1 year ago
How do you suggest we go about it? You could use a workaround by handling the error or we can introduce a variant of getNode that returns null with invalid paths.
Since get_node
already returns a Result<Option<...>>
, and that's Ok(None)
if the last part of the path is missing, it should simply also return Ok(None)
when any other path segment is missing.
Calling
getNode([ "top-dir", "nested-dir", "file" ])
will result in an error instead of returningnull
. Where "top-dir" exists, but "nested-dir" and "file" do not.Given error: