raft: more descriptive panic info

This commit is contained in:
Yicheng Qin
2014-09-11 23:18:51 -07:00
parent 073411f23f
commit 30289dad5c

View File

@@ -2,6 +2,7 @@ package raft
import (
"bytes"
"fmt"
"math/rand"
"reflect"
"sort"
@@ -932,7 +933,7 @@ func newNetwork(peers ...Interface) *network {
case *blackHole:
npeers[id] = v
default:
panic("unimplemented")
panic(fmt.Sprintf("unexpected state machine type: %T", p))
}
}
return &network{