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

Commit

Permalink
fix: check errors by string
Browse files Browse the repository at this point in the history
Unfortunately, we return errors over the HTTP API and lose the type.
  • Loading branch information
Stebalien committed Aug 17, 2021
1 parent 7ad255a commit 46bf30e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions tests/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
}
}
Expand Down

0 comments on commit 46bf30e

Please sign in to comment.