Skip to content

Commit

Permalink
fix(namesys, merkledag) use static error
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Tiger Chow committed Oct 28, 2014
1 parent c534dae commit 0bfadea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions merkledag/merkledag.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 :(
Expand Down
4 changes: 3 additions & 1 deletion namesys/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
mh "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multihash"
)

var ErrNotFound = fmt.Errorf("namesys: name not found")

// DNSResolver implements a Resolver on DNS domains
type DNSResolver struct {
// TODO: maybe some sort of caching?
Expand Down Expand Up @@ -43,5 +45,5 @@ func (r *DNSResolver) Resolve(name string) (string, error) {
return t, nil
}

return "", fmt.Errorf("namesys: %v not found", name)
return "", ErrNotFound
}

0 comments on commit 0bfadea

Please sign in to comment.