Skip to content

Commit 9dae6f8

Browse files
committed
trying something
1 parent 9a0c373 commit 9dae6f8

File tree

1 file changed

+4
-28
lines changed

1 file changed

+4
-28
lines changed

sentry_sdk/utils.py

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,33 +1119,6 @@ def exc_info_from_error(error):
11191119
return exc_info
11201120

11211121

1122-
def get_full_stack():
1123-
# type: () -> List[Dict[str, Any]]
1124-
"""
1125-
Returns a serialized representation of the full stack from the first frame that is not in sentry_sdk.
1126-
"""
1127-
stack_info = []
1128-
1129-
# Walk up the stack
1130-
frame = sys._getframe(1) # type: Optional[FrameType]
1131-
while frame:
1132-
in_sdk = False
1133-
try:
1134-
if "sentry_sdk" in frame.f_code.co_filename:
1135-
in_sdk = True
1136-
except Exception:
1137-
pass
1138-
1139-
if not in_sdk:
1140-
stack_info.append(serialize_frame(frame))
1141-
1142-
frame = frame.f_back
1143-
1144-
stack_info.reverse()
1145-
1146-
return stack_info
1147-
1148-
11491122
def merge_stack_frames(frames, full_stack, client_options):
11501123
# type: (List[Dict[str, Any]], List[Dict[str, Any]], Optional[Dict[str, Any]]) -> List[Dict[str, Any]]
11511124
"""
@@ -1196,7 +1169,10 @@ def event_from_exception(
11961169
hint = event_hint_with_exc_info(exc_info)
11971170

11981171
if client_options and client_options.get("add_full_stack", DEFAULT_ADD_FULL_STACK):
1199-
full_stack = get_full_stack()
1172+
full_stack = current_stacktrace(
1173+
include_local_variables=client_options["include_local_variables"],
1174+
max_value_length=client_options["max_value_length"],
1175+
)["frames"]
12001176
else:
12011177
full_stack = None
12021178

0 commit comments

Comments
 (0)