Skip to content

Commit 336edf7

Browse files
authored
Deprecate last_event_id(). (#2749)
1 parent 4d1b814 commit 336edf7

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

scripts/init_serverless_sdk.py

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
Then the Handler function sstring should be replaced with
66
'sentry_sdk.integrations.init_serverless_sdk.sentry_lambda_handler'
77
"""
8+
89
import os
910
import sys
1011
import re

sentry_sdk/api.py

+1
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ def flush(
205205
@hubmethod
206206
def last_event_id():
207207
# type: () -> Optional[str]
208+
208209
return Hub.current.last_event_id()
209210

210211

sentry_sdk/hub.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,15 @@ def scope(self):
283283

284284
def last_event_id(self):
285285
# type: () -> Optional[str]
286-
"""Returns the last event ID."""
286+
"""
287+
Returns the last event ID.
288+
289+
.. deprecated:: 1.40.5
290+
This function is deprecated and will be removed in a future release. The functions `capture_event`, `capture_message`, and `capture_exception` return the event ID directly.
291+
"""
292+
logger.warning(
293+
"Deprecated: last_event_id is deprecated. This will be removed in the future. The functions `capture_event`, `capture_message`, and `capture_exception` return the event ID directly."
294+
)
287295
return self._last_event_id
288296

289297
def bind_client(

0 commit comments

Comments
 (0)