Include reason for panic on different listener addresses

This commit is contained in:
Matt Joiner 2015-05-20 15:45:58 +10:00
parent df6d21cfa0
commit 085dbaa8ff
1 changed files with 1 additions and 1 deletions

View File

@ -161,7 +161,7 @@ func (me *Client) PeerID() string {
func (me *Client) ListenAddr() (addr net.Addr) { func (me *Client) ListenAddr() (addr net.Addr) {
for _, l := range me.listeners { for _, l := range me.listeners {
if addr != nil && l.Addr().String() != addr.String() { if addr != nil && l.Addr().String() != addr.String() {
panic("listeners exist on different addresses") panic(fmt.Sprintf("listeners are on different addresses: %q != %q", l.Addr().String(), addr.String()))
} }
addr = l.Addr() addr = l.Addr()
} }