Skip to content

Commit 15ff162

Browse files
committed
Improve the documentation about newly added exception classes
1 parent 22cd31b commit 15ff162

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/python/grpcio/grpc/_cython/_cygrpc/aio/common.pyx.pxi

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,16 @@ _COMPRESSION_METADATA_STRING_MAPPING = {
7575
}
7676

7777
class BaseError(Exception):
78-
"""The base class for all exceptions generated by gRPC framework."""
78+
"""The base class for exceptions generated by gRPC AsyncIO stack."""
7979

8080

8181
class UsageError(BaseError):
82-
"""Raised when the usage might lead to undefined behavior."""
82+
"""Raised when the usage of API by applications is inappropriate.
83+
84+
For example, trying to invoke RPC on a closed channel, mixing two styles
85+
of streaming API on the client side. This exception should not be
86+
suppressed.
87+
"""
8388

8489

8590
class AbortError(BaseError):
@@ -91,4 +96,4 @@ class AbortError(BaseError):
9196

9297

9398
class InternalError(BaseError):
94-
"""Raised when unexpected error returned by Core."""
99+
"""Raised upon unexpected errors in native code."""

src/python/grpcio/grpc/experimental/aio/_call.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,10 @@ async def write(self, request: RequestType) -> None:
443443
await self._write(request)
444444

445445
async def done_writing(self) -> None:
446-
"""Implementation of done_writing is idempotent."""
446+
"""Signal peer that client is done writing.
447+
448+
This method is idempotent.
449+
"""
447450
self._raise_for_different_style(_APIStyle.READER_WRITER)
448451
await self._done_writing()
449452

0 commit comments

Comments
 (0)