1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-07-01 02:30:39 +08:00

fix(exch) name the error

This commit is contained in:
Brian Tiger Chow
2014-09-21 02:26:23 -07:00
parent b5ea124a76
commit b4ef99bc81

View File

@ -10,6 +10,8 @@ import (
u "github.com/jbenet/go-ipfs/util" u "github.com/jbenet/go-ipfs/util"
) )
var OfflineMode = errors.New("Block unavailable. Operating in offline mode")
func NewOfflineExchange() exchange.Interface { func NewOfflineExchange() exchange.Interface {
return &offlineExchange{} return &offlineExchange{}
} }
@ -23,7 +25,7 @@ type offlineExchange struct {
// given key. // given key.
// NB: This function may return before the timeout expires. // NB: This function may return before the timeout expires.
func (_ *offlineExchange) Block(context.Context, u.Key) (*blocks.Block, error) { func (_ *offlineExchange) Block(context.Context, u.Key) (*blocks.Block, error) {
return nil, errors.New("Block unavailable. Operating in offline mode") return nil, OfflineMode
} }
// HasBlock always returns nil. // HasBlock always returns nil.