1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-30 09:59:13 +08:00

refactor(blockservice) export blockservice.ErrNotFound

This commit is contained in:
Brian Tiger Chow
2014-10-28 02:19:09 -07:00
parent cee1e9ccda
commit 1f9541d29b

View File

@ -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
}
}