1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-28 00:39:31 +08:00

fail with error when running diagnostic in offline mode

This commit is contained in:
Jeromy
2014-10-09 23:21:40 -07:00
parent 5c14df0a13
commit 808cf9dfc0

View File

@ -2,6 +2,7 @@ package commands
import (
"encoding/json"
"errors"
"io"
"time"
@ -9,6 +10,9 @@ import (
)
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)
if err != nil {
return err