mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-30 01:52:26 +08:00
fix(exch) name the error
This commit is contained in:
@ -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.
|
||||||
|
Reference in New Issue
Block a user