Skip to content

Commit 2f0e1f4

Browse files
ensure scopes are not none
1 parent 58535a3 commit 2f0e1f4

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

sentry_sdk/utils.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1517,15 +1517,16 @@ def run(self):
15171517

15181518
from sentry_sdk.scope import use_isolation_scope, use_scope
15191519

1520-
with use_isolation_scope(self.isolation_scope):
1521-
with use_scope(self.current_scope):
1522-
# with use_scope(self.current_scope):
1523-
# Raising Exception after timeout duration is reached
1524-
raise ServerlessTimeoutWarning(
1525-
"WARNING : Function is expected to get timed out. Configured timeout duration = {} seconds.".format(
1526-
integer_configured_timeout
1520+
if self.isolation_scope is not None and self.current_scope is not None:
1521+
with use_isolation_scope(self.isolation_scope):
1522+
with use_scope(self.current_scope):
1523+
# with use_scope(self.current_scope):
1524+
# Raising Exception after timeout duration is reached
1525+
raise ServerlessTimeoutWarning(
1526+
"WARNING : Function is expected to get timed out. Configured timeout duration = {} seconds.".format(
1527+
integer_configured_timeout
1528+
)
15271529
)
1528-
)
15291530

15301531

15311532
def to_base64(original):

0 commit comments

Comments
 (0)