提交 b4ef99bc 作者: Brian Tiger Chow

fix(exch) name the error

上级 b5ea124a
...@@ -10,6 +10,8 @@ import ( ...@@ -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 { ...@@ -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.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论