99
1010from sentry_sdk .utils import Dsn , logger , capture_internal_exceptions , json_dumps
1111from sentry_sdk .worker import BackgroundWorker
12- from sentry_sdk .envelope import Envelope , get_event_data_category
12+ from sentry_sdk .envelope import Envelope
1313
1414from sentry_sdk ._types import MYPY
1515
@@ -58,7 +58,8 @@ def capture_event(
5858 self , event # type: Event
5959 ):
6060 # type: (...) -> None
61- """This gets invoked with the event dictionary when an event should
61+ """
62+ This gets invoked with the event dictionary when an event should
6263 be sent to sentry.
6364 """
6465 raise NotImplementedError ()
@@ -67,14 +68,15 @@ def capture_envelope(
6768 self , envelope # type: Envelope
6869 ):
6970 # type: (...) -> None
70- """This gets invoked with an envelope when an event should
71- be sent to sentry. The default implementation invokes `capture_event`
72- if the envelope contains an event and ignores all other envelopes.
7371 """
74- event = envelope .get_event ()
75- if event is not None :
76- self .capture_event (event )
77- return None
72+ Send an envelope to Sentry.
73+
74+ Envelopes are a data container format that can hold any type of data
75+ submitted to Sentry. We use it for transactions and sessions, but
76+ regular "error" events should go through `capture_event` for backwards
77+ compat.
78+ """
79+ raise NotImplementedError ()
7880
7981 def flush (
8082 self ,
@@ -208,7 +210,8 @@ def _send_event(
208210 self , event # type: Event
209211 ):
210212 # type: (...) -> None
211- if self ._check_disabled (get_event_data_category (event )):
213+
214+ if self ._check_disabled ("error" ):
212215 return None
213216
214217 body = io .BytesIO ()
0 commit comments