diff --git a/blockservice/blockservice.go b/blockservice/blockservice.go index acb6564ed63..54a992cdb6e 100644 --- a/blockservice/blockservice.go +++ b/blockservice/blockservice.go @@ -1,6 +1,7 @@ package blockservice import ( + "errors" "fmt" context "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context" @@ -13,6 +14,7 @@ import ( ) var log = u.Logger("blockservice") +var ErrNotFound = errors.New("blockservice: key not found") // BlockService is a block datastore. // It uses an internal `datastore.Datastore` instance to store values. @@ -73,7 +75,7 @@ func (s *BlockService) GetBlock(ctx context.Context, k u.Key) (*blocks.Block, er return blk, nil } else { log.Debug("Blockservice GetBlock: Not found.") - return nil, u.ErrNotFound + return nil, ErrNotFound } } diff --git a/merkledag/merkledag.go b/merkledag/merkledag.go index 0e595c9d693..a7eb05d7c61 100644 --- a/merkledag/merkledag.go +++ b/merkledag/merkledag.go @@ -13,6 +13,7 @@ import ( ) var log = u.Logger("merkledag") +var ErrNotFound = fmt.Errorf("merkledag: not found") // NodeMap maps u.Keys to Nodes. // We cannot use []byte/Multihash for keys :( @@ -103,7 +104,7 @@ func (n *Node) RemoveNodeLink(name string) error { return nil } } - return u.ErrNotFound + return ErrNotFound } // Copy returns a copy of the node. diff --git a/namesys/dns.go b/namesys/dns.go index 66448511f85..881979930a0 100644 --- a/namesys/dns.go +++ b/namesys/dns.go @@ -6,8 +6,6 @@ import ( b58 "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-base58" isd "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-is-domain" mh "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multihash" - - u "github.com/jbenet/go-ipfs/util" ) // DNSResolver implements a Resolver on DNS domains @@ -44,5 +42,5 @@ func (r *DNSResolver) Resolve(name string) (string, error) { return t, nil } - return "", u.ErrNotFound + return "", ErrResolveFailed }