Commit 1f9541d2 authored by Brian Tiger Chow's avatar Brian Tiger Chow

refactor(blockservice) export blockservice.ErrNotFound

parent cee1e9cc
package blockservice package blockservice
import ( import (
"errors"
"fmt" "fmt"
context "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context" context "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context"
...@@ -13,6 +14,7 @@ import ( ...@@ -13,6 +14,7 @@ import (
) )
var log = u.Logger("blockservice") var log = u.Logger("blockservice")
var ErrNotFound = errors.New("blockservice: key not found")
// BlockService is a block datastore. // BlockService is a block datastore.
// It uses an internal `datastore.Datastore` instance to store values. // 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 ...@@ -73,7 +75,7 @@ func (s *BlockService) GetBlock(ctx context.Context, k u.Key) (*blocks.Block, er
return blk, nil return blk, nil
} else { } else {
log.Debug("Blockservice GetBlock: Not found.") log.Debug("Blockservice GetBlock: Not found.")
return nil, u.ErrNotFound return nil, ErrNotFound
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment