Skip to content

Commit 00c542f

Browse files
authored
feat: Add attach_stacktrace option (#106)
1 parent 15c782e commit 00c542f

File tree

12 files changed

+87
-19
lines changed

12 files changed

+87
-19
lines changed

sentry_sdk/consts.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"before_send": None,
2727
"before_breadcrumb": None,
2828
"debug": False,
29+
"attach_stacktrace": True,
2930
}
3031

3132

sentry_sdk/hub.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,7 @@ def capture_exception(self, error=None):
161161
else:
162162
exc_info = exc_info_from_error(error)
163163

164-
event, hint = event_from_exception(
165-
exc_info, with_locals=client.options["with_locals"]
166-
)
164+
event, hint = event_from_exception(exc_info, client_options=client.options)
167165
try:
168166
return self.capture_event(event, hint=hint)
169167
except Exception:

sentry_sdk/integrations/_wsgi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def _capture_exception(hub):
169169
exc_info = sys.exc_info()
170170
event, hint = event_from_exception(
171171
exc_info,
172-
with_locals=hub.client.options["with_locals"],
172+
client_options=hub.client.options,
173173
mechanism={"type": "wsgi", "handled": False},
174174
)
175175
hub.capture_event(event, hint=hint)

sentry_sdk/integrations/aws_lambda.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def sentry_handler(event, context, *args, **kwargs):
4141
exc_info = sys.exc_info()
4242
event, hint = event_from_exception(
4343
exc_info,
44-
with_locals=hub.client.options["with_locals"],
44+
client_options=hub.client.options,
4545
mechanism={"type": "aws_lambda", "handled": False},
4646
)
4747

sentry_sdk/integrations/celery.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def _process_failure_signal(self, sender, task_id, einfo, **kw):
4545
def _capture_event(self, hub, exc_info):
4646
event, hint = event_from_exception(
4747
exc_info,
48-
with_locals=hub.client.options["with_locals"],
48+
client_options=hub.client.options,
4949
mechanism={"type": "celery", "handled": False},
5050
)
5151

sentry_sdk/integrations/django/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def _got_request_exception(request=None, **kwargs):
125125
hub = Hub.current
126126
event, hint = event_from_exception(
127127
sys.exc_info(),
128-
with_locals=hub.client.options["with_locals"],
128+
client_options=hub.client.options,
129129
mechanism={"type": "django", "handled": False},
130130
)
131131

sentry_sdk/integrations/excepthook.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def sentry_sdk_excepthook(exctype, value, traceback):
2323
hub = Hub.current
2424
event, hint = event_from_exception(
2525
(exctype, value, traceback),
26-
with_locals=hub.client.options["with_locals"],
26+
client_options=hub.client.options,
2727
mechanism={"type": "excepthook", "handled": False},
2828
)
2929
hub.capture_event(event, hint=hint)

sentry_sdk/integrations/flask.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def _capture_exception(sender, exception, **kwargs):
126126
hub = Hub.current
127127
event, hint = event_from_exception(
128128
exception,
129-
with_locals=hub.client.options["with_locals"],
129+
client_options=hub.client.options,
130130
mechanism={"type": "flask", "handled": False},
131131
)
132132

sentry_sdk/integrations/logging.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def _emit(self, record):
8484
if record.exc_info is not None and record.exc_info[0] is not None:
8585
event, hint = event_from_exception(
8686
record.exc_info,
87-
with_locals=hub.client.options["with_locals"],
87+
client_options=hub.client.options,
8888
mechanism={"type": "logging", "handled": True},
8989
)
9090
else:

sentry_sdk/integrations/sanic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def _capture_exception(exception):
8585
hub = Hub.current
8686
event, hint = event_from_exception(
8787
exception,
88-
with_locals=hub.client.options["with_locals"],
88+
client_options=hub.client.options,
8989
mechanism={"type": "sanic", "handled": False},
9090
)
9191

0 commit comments

Comments
 (0)