Skip to content

Commit 5c20b12

Browse files
committed
be more defensive
1 parent d49038b commit 5c20b12

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sentry_sdk/tracing_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import uuid
88
from collections.abc import Mapping
99
from datetime import datetime, timedelta, timezone
10-
from decimal import ROUND_DOWN, Context, Decimal, InvalidOperation
10+
from decimal import ROUND_DOWN, Context, Decimal
1111
from functools import wraps
1212
from random import Random
1313
from urllib.parse import quote, unquote
@@ -466,7 +466,7 @@ def _fill_sample_rand(self):
466466
if sentry_baggage.get("sample_rand"):
467467
try:
468468
sample_rand = Decimal(sentry_baggage["sample_rand"])
469-
except (ValueError, InvalidOperation):
469+
except Exception:
470470
logger.debug(
471471
f"Failed to convert incoming sample_rand to int: {sample_rand}"
472472
)
@@ -479,7 +479,7 @@ def _fill_sample_rand(self):
479479
if sentry_baggage.get("sample_rate"):
480480
try:
481481
sample_rate = float(sentry_baggage["sample_rate"])
482-
except (ValueError, KeyError):
482+
except Exception:
483483
logger.debug(
484484
f"Failed to convert incoming sample_rate to float: {sample_rate}"
485485
)

0 commit comments

Comments
 (0)