Skip to content

Commit

Permalink
Document that all errors from RPCs are status errors (grpc#1782)
Browse files Browse the repository at this point in the history
  • Loading branch information
menghanl authored Jan 5, 2018
1 parent 8a8ac82 commit 6913ad5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions call.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ func sendRequest(ctx context.Context, dopts dialOptions, compressor Compressor,

// Invoke sends the RPC request on the wire and returns after response is
// received. This is typically called by generated code.
//
// All errors returned by Invoke are compatible with the status package.
func (cc *ClientConn) Invoke(ctx context.Context, method string, args, reply interface{}, opts ...CallOption) error {
if cc.dopts.unaryInt != nil {
return cc.dopts.unaryInt(ctx, method, args, reply, cc, invoke, opts...)
Expand Down
2 changes: 2 additions & 0 deletions stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ type StreamDesc struct {
}

// Stream defines the common interface a client or server stream has to satisfy.
//
// All errors returned from Stream are compatible with the status package.
type Stream interface {
// Context returns the context for this stream.
Context() context.Context
Expand Down

0 comments on commit 6913ad5

Please sign in to comment.