From 46bf30ed94c7c4f74fae3841f046003a33dbe33d Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 17 Aug 2021 13:10:26 -0700 Subject: [PATCH] fix: check errors by string Unfortunately, we return errors over the HTTP API and lose the type. --- tests/path.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/path.go b/tests/path.go index 5a249fa..2e4a34d 100644 --- a/tests/path.go +++ b/tests/path.go @@ -2,12 +2,10 @@ package tests import ( "context" - "errors" "math" "strings" "testing" - "github.com/ipfs/go-path/resolver" "github.com/ipfs/interface-go-ipfs-core/path" "github.com/ipfs/interface-go-ipfs-core/options" @@ -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 baz") { t.Fatalf("unexpected error: %s", err) } }