fail with error when running diagnostic in offline mode
Jeromy committed
Oct 9, 2014 at 23:21 UTC
808cf9dfc0b74e3edeadeebeaa2d4ad084b2e32a
1 file changed
+4
core/commands/diag.go
+4
@@ -2,6 +2,7 @@ package commands
2
3
import (
4
"encoding/json"
5
+ "errors"
6
"io"
7
"time"
8
@@ -9,6 +10,9 @@ import (
10
)
11
12
func Diag(n *core.IpfsNode, args []string, opts map[string]interface{}, out io.Writer) error {
13
+ if n.Diagnostics == nil {
14
+ return errors.New("Cannot run diagnostic in offline mode!")
15
+ }
16
info, err := n.Diagnostics.GetDiagnostic(time.Second * 20)
17
if err != nil {
18
return err