Skip to content

Commit 8199aff

Browse files
committed
Fix Python blocking interceptors facing RpcError
RpcError should be returned from the continuation intact, not raised.
1 parent c5d22df commit 8199aff

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

AUTHORS

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
Dropbox, Inc.
12
Google Inc.
23
WeWork Companies Inc.

src/python/grpcio/grpc/_interceptor.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,8 @@ def continuation(new_details, request):
232232
credentials=new_credentials,
233233
wait_for_ready=new_wait_for_ready)
234234
return _UnaryOutcome(response, call)
235-
except grpc.RpcError:
236-
raise
235+
except grpc.RpcError as rpc_error:
236+
return rpc_error
237237
except Exception as exception: # pylint:disable=broad-except
238238
return _FailureOutcome(exception, sys.exc_info()[2])
239239

@@ -354,8 +354,8 @@ def continuation(new_details, request_iterator):
354354
credentials=new_credentials,
355355
wait_for_ready=new_wait_for_ready)
356356
return _UnaryOutcome(response, call)
357-
except grpc.RpcError:
358-
raise
357+
except grpc.RpcError as rpc_error:
358+
return rpc_error
359359
except Exception as exception: # pylint:disable=broad-except
360360
return _FailureOutcome(exception, sys.exc_info()[2])
361361

0 commit comments

Comments
 (0)