Refactor: rename _LocalFailure to _FailureOutcome

pull/14639/head
Mehrdad Afshari 7 years ago
parent e2ebd89a5f
commit e9cbad592e
  1. 16
      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):

Loading…
Cancel
Save