change error message from InvalidArgument to ResourceExhausted

This commit is contained in:
Yuxuan Li
2017-04-13 16:51:56 -07:00
parent 8788b75675
commit cb02ab4d25
5 changed files with 65 additions and 65 deletions

View File

@ -123,7 +123,7 @@ func sendRequest(ctx context.Context, dopts dialOptions, compressor Compressor,
return nil, Errorf(codes.Internal, "grpc: %v", err)
}
if len(outBuf) > msgSizeLimit {
return nil, Errorf(codes.InvalidArgument, "Sent message larger than max (%d vs. %d)", len(outBuf), msgSizeLimit)
return nil, Errorf(codes.ResourceExhausted, "Sent message larger than max (%d vs. %d)", len(outBuf), msgSizeLimit)
}
err = t.Write(stream, outBuf, opts)
if err == nil && outPayload != nil {