add isclient to errorstats

This commit is contained in:
Menghan Li
2016-11-01 14:13:31 -07:00
parent 1054f1c42b
commit aa914665f0
2 changed files with 5 additions and 0 deletions

View File

@ -144,6 +144,8 @@ func (s *OutgoingTrailerStats) isStats() {}
// ErrorStats indicates an error happens.
type ErrorStats struct {
// IsClient indicates if this stats is a client stats.
IsClient bool
// Error is the error just happened. Its type is gRPC error.
Error error
}

View File

@ -474,6 +474,9 @@ func checkErrorStats(t *testing.T, d *gotData, e *expectedData) {
if d.ctx == nil {
t.Fatalf("d.ctx = nil, want <non-nil>")
}
if st.IsClient {
t.Fatalf("st IsClient = true, want false")
}
if grpc.Code(st.Error) != grpc.Code(e.err) || grpc.ErrorDesc(st.Error) != grpc.ErrorDesc(e.err) {
t.Fatalf("st.Error = %v, want %v", st.Error, e.err)
}