Skip to content

Commit 6913ad5

Browse files
authored
Document that all errors from RPCs are status errors (grpc#1782)
1 parent 8a8ac82 commit 6913ad5

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

call.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ func sendRequest(ctx context.Context, dopts dialOptions, compressor Compressor,
138138

139139
// Invoke sends the RPC request on the wire and returns after response is
140140
// received. This is typically called by generated code.
141+
//
142+
// All errors returned by Invoke are compatible with the status package.
141143
func (cc *ClientConn) Invoke(ctx context.Context, method string, args, reply interface{}, opts ...CallOption) error {
142144
if cc.dopts.unaryInt != nil {
143145
return cc.dopts.unaryInt(ctx, method, args, reply, cc, invoke, opts...)

stream.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ type StreamDesc struct {
5050
}
5151

5252
// Stream defines the common interface a client or server stream has to satisfy.
53+
//
54+
// All errors returned from Stream are compatible with the status package.
5355
type Stream interface {
5456
// Context returns the context for this stream.
5557
Context() context.Context

0 commit comments

Comments
 (0)