Improve the documentation about newly added exception classes

pull/21910/head
Lidi Zheng 5 years ago
parent 22cd31b0ec
commit 15ff162fe3
  1. 11
      src/python/grpcio/grpc/_cython/_cygrpc/aio/common.pyx.pxi
  2. 5
      src/python/grpcio/grpc/experimental/aio/_call.py

@ -75,11 +75,16 @@ _COMPRESSION_METADATA_STRING_MAPPING = {
}
class BaseError(Exception):
"""The base class for all exceptions generated by gRPC framework."""
"""The base class for exceptions generated by gRPC AsyncIO stack."""
class UsageError(BaseError):
"""Raised when the usage might lead to undefined behavior."""
"""Raised when the usage of API by applications is inappropriate.
For example, trying to invoke RPC on a closed channel, mixing two styles
of streaming API on the client side. This exception should not be
suppressed.
"""
class AbortError(BaseError):
@ -91,4 +96,4 @@ class AbortError(BaseError):
class InternalError(BaseError):
"""Raised when unexpected error returned by Core."""
"""Raised upon unexpected errors in native code."""

@ -443,7 +443,10 @@ class _StreamRequestMixin(Call):
await self._write(request)
async def done_writing(self) -> None:
"""Implementation of done_writing is idempotent."""
"""Signal peer that client is done writing.
This method is idempotent.
"""
self._raise_for_different_style(_APIStyle.READER_WRITER)
await self._done_writing()

Loading…
Cancel
Save