Преглед изворни кода

raft: more descriptive panic info

Yicheng Qin пре 11 година
родитељ
комит
30289dad5c
1 измењених фајлова са 2 додато и 1 уклоњено
  1. 2 1
      raft/raft_test.go

+ 2 - 1
raft/raft_test.go

@@ -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{