panic -> error
Juan Batiz-Benet committed
Aug 29, 2014 at 23:58 UTC
d934806eaf20f2583c348b190881c61840be3c08
1 file changed
+1
-1
swarm/swarm.go
+1
-1
@@ -409,7 +409,7 @@ func (s *Swarm) GetConnection(id peer.ID, addr *ma.Multiaddr) (*peer.Peer, error
409
}
410
411
if id.Equal(s.local.ID) {
412
- panic("Attempted connection to self!")
412
+ return nil, errors.New("Attempted connection to self!")
413
}
414
415
conn, err, reused := s.Dial(p)