Commit 808cf9df authored by Jeromy's avatar Jeromy

fail with error when running diagnostic in offline mode

parent 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 is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment