This repository has been archived by the owner on Jun 19, 2023. It is now read-only.
Update error message for go-ipld-prime path resolution #75
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.
Arising out of the go-ipld-prime in go-ipfs work. Failing @ ipfs/kubo#7995
@hannahhoward's updates to go-path now use go-ipld-prime selector traversal to do path resolution and we get more verbose error messages.
In this change I'm allowing both the old and the new style error messages. I'm unsure if that's appropriate or not but it seems to me that coordinating this getting up through go-ipfs-http-client to go-ipfs is going to be awkward enough that being a little more lax about exact message is fine and can be resolved at some future date. I'm also making an assumption that we shouldn't be trying to emulate the old style error message when the new one is more informative.
While I'm in here, I'm not sure this test is doing what it should be testing. We have a block that looks like
{"foo": {"bar": "baz"}}
with CIDX
, then we're requesting a path through that block:X/bar/baz
where there is nobar
at the top level. This test is called "InvalidPathRemainder" but it's not even getting started. Is it testing what it should be testing? Was it supposed to be testingX/foo/bar/baz
perhaps? 🤷 maybe we could clarify what this test is supposed to be doing while in here.