Skip to content

Commit

Permalink
status for exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
majorgreys committed Jun 16, 2020
1 parent 3eae958 commit e18452c
Showing 1 changed file with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,18 +188,21 @@ def _trace_failure(*args, **kwargs):
if span is None:
return

status_kwargs = {"canonical_code": StatusCanonicalCode.UNKNOWN}

ex = kwargs.get("einfo")
if ex is None:
return
if hasattr(task, "throws") and isinstance(ex.exception, task.throws):

if (
hasattr(task, "throws")
and ex is not None
and isinstance(ex.exception, task.throws)
):
return

span.set_status(
Status(
canonical_code=StatusCanonicalCode.UNKNOWN,
description=str(ex),
)
)
if ex is not None:
status_kwargs["description"] = str(ex)

span.set_status(Status(**status_kwargs))

@staticmethod
def _trace_retry(*args, **kwargs):
Expand Down

0 comments on commit e18452c

Please sign in to comment.