Skip to content

Commit b54a5a8

Browse files
committed
Refactor
1 parent bfcd6e9 commit b54a5a8

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

temporalio/contrib/opentelemetry.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,13 @@ def _start_as_current_span(
194194
)
195195
raise
196196
except Exception as exc:
197-
span.set_status(
198-
Status(
199-
status_code=StatusCode.ERROR,
200-
description=f"{type(exc).__name__}: {exc}",
197+
if not isinstance(exc, ApplicationError) or exc.category != ApplicationErrorCategory.BENIGN:
198+
span.set_status(
199+
Status(
200+
status_code=StatusCode.ERROR,
201+
description=f"{type(exc).__name__}: {exc}",
202+
)
201203
)
202-
)
203204
raise
204205

205206
def _completed_workflow_span(

0 commit comments

Comments
 (0)