Skip to content

Commit be40b7e

Browse files
authored
ref: Change argument order for hint and scope (#41)
1 parent ccd083f commit be40b7e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

sentry_sdk/client.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def disabled(cls):
8282
"""Creates a guarnateed to be disabled client."""
8383
return cls(NO_DSN)
8484

85-
def _prepare_event(self, event, scope, hint=None):
85+
def _prepare_event(self, event, hint, scope):
8686
if event.get("timestamp") is None:
8787
event["timestamp"] = datetime.utcnow()
8888

@@ -137,7 +137,7 @@ def _is_ignored_error(self, event, hint=None):
137137

138138
return False
139139

140-
def _should_capture(self, event, scope=None, hint=None):
140+
def _should_capture(self, event, hint=None, scope=None):
141141
if (
142142
self.options["sample_rate"] < 1.0
143143
and random.random() >= self.options["sample_rate"]
@@ -149,15 +149,15 @@ def _should_capture(self, event, scope=None, hint=None):
149149

150150
return True
151151

152-
def capture_event(self, event, scope=None, hint=None):
152+
def capture_event(self, event, hint=None, scope=None):
153153
"""Captures an event."""
154154
if self._transport is None:
155155
return
156156
rv = event.get("event_id")
157157
if rv is None:
158158
event["event_id"] = rv = uuid.uuid4().hex
159-
if self._should_capture(event, scope, hint):
160-
event = self._prepare_event(event, scope, hint)
159+
if self._should_capture(event, hint, scope):
160+
event = self._prepare_event(event, hint, scope)
161161
if event is not None:
162162
self._transport.capture_event(event)
163163
return rv

sentry_sdk/hub.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def capture_event(self, event, hint=None):
110110
"""Captures an event."""
111111
client, scope = self._stack[-1]
112112
if client is not None:
113-
rv = client.capture_event(event, scope, hint)
113+
rv = client.capture_event(event, hint, scope)
114114
if rv is not None:
115115
self._last_event_id = rv
116116
return rv

0 commit comments

Comments
 (0)