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:
@ -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
|
||||
|
Reference in New Issue
Block a user