提交 808cf9df 作者: Jeromy

fail with error when running diagnostic in offline mode

上级 5c14df0a
...@@ -2,6 +2,7 @@ package commands ...@@ -2,6 +2,7 @@ package commands
import ( import (
"encoding/json" "encoding/json"
"errors"
"io" "io"
"time" "time"
...@@ -9,6 +10,9 @@ import ( ...@@ -9,6 +10,9 @@ import (
) )
func Diag(n *core.IpfsNode, args []string, opts map[string]interface{}, out io.Writer) error { func Diag(n *core.IpfsNode, args []string, opts map[string]interface{}, out io.Writer) error {
if n.Diagnostics == nil {
return errors.New("Cannot run diagnostic in offline mode!")
}
info, err := n.Diagnostics.GetDiagnostic(time.Second * 20) info, err := n.Diagnostics.GetDiagnostic(time.Second * 20)
if err != nil { if err != nil {
return err return err
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论