mirror of https://github.com/grpc/grpc-go.git
add isclient to errorstats
This commit is contained in:
parent
1054f1c42b
commit
aa914665f0
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue