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
juliobastida-cargoone committed Aug 26, 2020
1 parent e1d3c3b commit 8cf0128
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 8cf0128

Please sign in to comment.