Skip to content
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.

fix: check errors by string #76

Merged
merged 1 commit into from
Aug 17, 2021
Merged

fix: check errors by string #76

merged 1 commit into from
Aug 17, 2021

Conversation

Stebalien
Copy link
Member

Unfortunately, we return errors over the HTTP API and lose the type.

@Stebalien Stebalien force-pushed the fix/check-error-as-string branch 2 times, most recently from 46bf30e to c40a693 Compare August 17, 2021 20:26
Unfortunately, we return errors over the HTTP API and lose the type.
@@ -141,7 +139,7 @@ func (tp *TestSuite) TestInvalidPathRemainder(t *testing.T) {
}

_, err = api.ResolvePath(ctx, path.New("/ipld/"+nd.Cid().String()+"/bar/baz"))
if err == nil || !errors.As(err, &resolver.ErrNoLink{}) {
if err == nil || !strings.Contains(err.Error(), `no link named "bar"`) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to do this because there are HTTP API implementations of this interface (i.e.https://github.com/ipfs/go-ipfs-http-client) and we don't send the full type information over the wire.

So for now we're stuck with string checking the errors.

@Stebalien Stebalien merged commit 275b80e into master Aug 17, 2021
@Stebalien Stebalien deleted the fix/check-error-as-string branch August 17, 2021 20:37
@aschmahmann aschmahmann mentioned this pull request Dec 1, 2021
80 tasks
guseggert pushed a commit to ipfs/boxo that referenced this pull request Dec 6, 2022
…-error-as-string

fix: check errors by string

This commit was moved from ipfs/interface-go-ipfs-core@275b80e
guseggert pushed a commit to ipfs/boxo that referenced this pull request Mar 15, 2023
…-error-as-string

fix: check errors by string

This commit was moved from ipfs/interface-go-ipfs-core@275b80e
Jorropo pushed a commit to ipfs/go-libipfs-rapide that referenced this pull request Mar 23, 2023
…-error-as-string

fix: check errors by string

This commit was moved from ipfs/interface-go-ipfs-core@275b80e
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants