Skip to content

Commit

Permalink
Check if response has exception before trying to access result
Browse files Browse the repository at this point in the history
  • Loading branch information
ingeneer committed Aug 26, 2020
1 parent e1d3c3b commit 883e14c
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,12 @@ def _intercept_call(

def _callback(self, current_span):
def callback(future_response):
grpc_utils.add_message_event(
proto_message=future_response.result(),
span=current_span,
message_event_type=time_event.Type.RECEIVED,
)
if not future_response.exception():
grpc_utils.add_message_event(
proto_message=future_response.result(),
span=current_span,
message_event_type=time_event.Type.RECEIVED,
)
self._trace_future_exception(future_response)
self.tracer.end_span()

Expand Down

0 comments on commit 883e14c

Please sign in to comment.