8000 fix: Convert assertion into warning by untitaker · Pull Request #474 · getsentry/sentry-python · GitHub
[go: up one dir, main page]

Skip to content

fix: Convert assertion into warning #474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 19, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions sentry_sdk/tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from datetime import datetime

import sentry_sdk
from sentry_sdk.utils import capture_internal_exceptions
from sentry_sdk.utils import capture_internal_exceptions, logger
from sentry_sdk._compat import PY2
from sentry_sdk._types import MYPY

Expand Down Expand Up @@ -272,9 +272,9 @@ def finish(self, hub=None):
# resolved to a concrete decision. If `sampled` is `None`, it's
# likely that somebody used `with sentry_sdk.Hub.start_span(..)` on a
# non-transaction span and later decided to make it a transaction.
assert (
self.sampled is not None
), "Need to set transaction when entering span!"
if self.sampled is None:
logger.warning("Discarding transaction Span without sampling decision")

return None

return hub.capture_event(
Expand Down
0