diff --git a/src/python/grpcio/grpc/experimental/aio/_call.py b/src/python/grpcio/grpc/experimental/aio/_call.py index fb7f486966c..1a43c44f5c5 100644 --- a/src/python/grpcio/grpc/experimental/aio/_call.py +++ b/src/python/grpcio/grpc/experimental/aio/_call.py @@ -142,14 +142,13 @@ class AioRpcError(grpc.RpcError): def _create_rpc_error(initial_metadata: Optional[MetadataType], - status: cygrpc.AioRpcStatus, - debug_error_string: Optional[str] = None) -> AioRpcError: + status: cygrpc.AioRpcStatus) -> AioRpcError: return AioRpcError( _common.CYGRPC_STATUS_CODE_TO_STATUS_CODE[status.code()], status.details(), initial_metadata, status.trailing_metadata(), - debug_error_string, + status.debug_error_string(), ) @@ -275,12 +274,8 @@ class _UnaryResponseMixin(Call): if self._cython_call.is_locally_cancelled(): raise asyncio.CancelledError() else: - call_status = self._cython_call._status - debug_error_string = None - if call_status is not None: - debug_error_string = call_status._debug_error_string raise _create_rpc_error(self._cython_call._initial_metadata, - call_status, debug_error_string) + self._cython_call._status) else: return response