- Author(s): XuanWang-Amos
- Approver: gnossen
- Status: In Review
- Implemented in: Python
- Last updated: 08/31/2023
- Discussion at: https://groups.google.com/g/grpc-io/c/pG34X9nAa3c
- Add two new errors in grpc public API:
- BaseError
- AbortError
- Also changed RpcError to be a subclass of BaseError.
In case of abort, currently we don't log anything, exposing those error types allows user to catch and handle aborts if they want.
- Add AbortError and BaseError in public API.
- Change RpcError to be a subclass of BaseError.
The Async API has similar errors. We're refactoring code so those errors will also be used in Sync API. Adding them to the Sync API will help us keep the two stacks in sync and allow users of the Sync implementation to catch and handle aborts.
We also plan to change RpcError to be a subclass of BaseError so that all grpc errors are a subclass of BaseError, this will allow users to catching all gRPC exceptions use code like this:
try:
do_grpc_stuff()
except grpc.BaseError as e:
# handle error
And and check AbortError while abort : grpc/grpc#33969