1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-07-01 10:49:24 +08:00

check mode with use func node.OnlineMode() bool

This commit is contained in:
Brian Tiger Chow
2014-11-06 03:41:19 -08:00
committed by Juan Batiz-Benet
parent 772f657fcd
commit 8b6931cb02

View File

@ -31,7 +31,7 @@ var diagCmd = &cmds.Command{
Run: func(res cmds.Response, req cmds.Request) {
n := req.Context().Node
if n.Diagnostics == nil {
if !n.Online() {
res.SetError(errors.New("Cannot run diagnostic in offline mode!"), cmds.ErrNormal)
return
}