From e9cbad592ed50511569fbc1c52b232341bbe1bd9 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Thu, 8 Mar 2018 12:32:07 +0100 Subject: [PATCH] Refactor: rename _LocalFailure to _FailureOutcome --- src/python/grpcio/grpc/_interceptor.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/python/grpcio/grpc/_interceptor.py b/src/python/grpcio/grpc/_interceptor.py index 36611fe5012..0980a4c6529 100644 --- a/src/python/grpcio/grpc/_interceptor.py +++ b/src/python/grpcio/grpc/_interceptor.py @@ -75,10 +75,10 @@ def _unwrap_client_call_details(call_details, default_details): return method, timeout, metadata, credentials -class _LocalFailure(grpc.RpcError, grpc.Future, grpc.Call): +class _FailureOutcome(grpc.RpcError, grpc.Future, grpc.Call): def __init__(self, exception, traceback): - super(_LocalFailure, self).__init__() + super(_FailureOutcome, self).__init__() self._exception = exception self._traceback = traceback @@ -216,7 +216,7 @@ class _UnaryUnaryMultiCallable(grpc.UnaryUnaryMultiCallable): credentials=new_credentials) return _UnaryOutcome(response, call) except Exception as exception: # pylint:disable=broad-except - return _LocalFailure(exception, sys.exc_info()[2]) + return _FailureOutcome(exception, sys.exc_info()[2]) call = self._interceptor.intercept_unary_unary( continuation, client_call_details, request) @@ -239,7 +239,7 @@ class _UnaryUnaryMultiCallable(grpc.UnaryUnaryMultiCallable): return self._interceptor.intercept_unary_unary( continuation, client_call_details, request) except Exception as exception: # pylint:disable=broad-except - return _LocalFailure(exception, sys.exc_info()[2]) + return _FailureOutcome(exception, sys.exc_info()[2]) class _UnaryStreamMultiCallable(grpc.UnaryStreamMultiCallable): @@ -266,7 +266,7 @@ class _UnaryStreamMultiCallable(grpc.UnaryStreamMultiCallable): return self._interceptor.intercept_unary_stream( continuation, client_call_details, request) except Exception as exception: # pylint:disable=broad-except - return _LocalFailure(exception, sys.exc_info()[2]) + return _FailureOutcome(exception, sys.exc_info()[2]) class _StreamUnaryMultiCallable(grpc.StreamUnaryMultiCallable): @@ -307,7 +307,7 @@ class _StreamUnaryMultiCallable(grpc.StreamUnaryMultiCallable): credentials=new_credentials) return _UnaryOutcome(response, call) except Exception as exception: # pylint:disable=broad-except - return _LocalFailure(exception, sys.exc_info()[2]) + return _FailureOutcome(exception, sys.exc_info()[2]) call = self._interceptor.intercept_stream_unary( continuation, client_call_details, request_iterator) @@ -334,7 +334,7 @@ class _StreamUnaryMultiCallable(grpc.StreamUnaryMultiCallable): return self._interceptor.intercept_stream_unary( continuation, client_call_details, request_iterator) except Exception as exception: # pylint:disable=broad-except - return _LocalFailure(exception, sys.exc_info()[2]) + return _FailureOutcome(exception, sys.exc_info()[2]) class _StreamStreamMultiCallable(grpc.StreamStreamMultiCallable): @@ -365,7 +365,7 @@ class _StreamStreamMultiCallable(grpc.StreamStreamMultiCallable): return self._interceptor.intercept_stream_stream( continuation, client_call_details, request_iterator) except Exception as exception: # pylint:disable=broad-except - return _LocalFailure(exception, sys.exc_info()[2]) + return _FailureOutcome(exception, sys.exc_info()[2]) class _Channel(grpc.Channel):