We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
None
1 parent 56139a3 commit 843d8c7Copy full SHA for 843d8c7
instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py
@@ -648,13 +648,15 @@ def __init__(
648
)
649
650
def failsafe(func):
651
+ if func is None:
652
+ return None
653
+
654
@wraps(func)
655
def wrapper(span: Span, *args, **kwargs):
- if func is not None:
- try:
- func(span, *args, **kwargs)
656
- except Exception as exc: # pylint: disable=broad-exception-caught
657
- span.record_exception(exc)
+ try:
+ func(span, *args, **kwargs)
658
+ except Exception as exc: # pylint: disable=broad-exception-caught
659
+ span.record_exception(exc)
660
661
return wrapper
662
0 commit comments