@cryptotaxi247 / kubo / commits / f10c8282c

handle error from GetClosestPeers

Jeromy committed Apr 6, 2015 at 00:08 UTC f10c8282c7bff3a0ed1d79a41d4a6c2a6cd8b399
1 file changed +4
core/commands/dht.go
+4
@@ -60,6 +60,10 @@ var queryDhtCmd = &cmds.Command{
60 ctx := notif.RegisterForQueryEvents(req.Context().Context, events)
61
62 closestPeers, err := dht.GetClosestPeers(ctx, u.Key(req.Arguments()[0]))
63 + if err != nil {
64 + res.SetError(err, cmds.ErrNormal)
65 + return
66 + }
67
68 go func() {
69 defer close(events)