Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion sentry_sdk/integrations/aiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,6 @@ def _capture_exception() -> "ExcInfo":
exc_info = sys.exc_info()
event, hint = event_from_exception(
exc_info,
client_options=sentry_sdk.get_client().options,
mechanism={"type": "aiohttp", "handled": False},
)
sentry_sdk.capture_event(event, hint=hint)
Expand Down
1 change: 0 additions & 1 deletion sentry_sdk/integrations/anthropic.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ def setup_once() -> None:
def _capture_exception(exc: "Any") -> None:
event, hint = event_from_exception(
exc,
client_options=sentry_sdk.get_client().options,
mechanism={"type": "anthropic", "handled": False},
)
sentry_sdk.capture_event(event, hint=hint)
Expand Down
2 changes: 0 additions & 2 deletions sentry_sdk/integrations/ariadne.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ def _sentry_patched_handle_graphql_errors(
for error in errors:
event, hint = event_from_exception(
error,
client_options=client.options,
mechanism={
"type": AriadneIntegration.identifier,
"handled": False,
Expand All @@ -105,7 +104,6 @@ def _sentry_patched_handle_query_result(
for error in result.errors or []:
event, hint = event_from_exception(
error,
client_options=client.options,
mechanism={
"type": AriadneIntegration.identifier,
"handled": False,
Expand Down
1 change: 0 additions & 1 deletion sentry_sdk/integrations/arq.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ def _capture_exception(exc_info: "ExcInfo") -> None:

event, hint = event_from_exception(
exc_info,
client_options=sentry_sdk.get_client().options,
mechanism={"type": ArqIntegration.identifier, "handled": False},
)
sentry_sdk.capture_event(event, hint=hint)
Expand Down
1 change: 0 additions & 1 deletion sentry_sdk/integrations/asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
def _capture_exception(exc: "Any", mechanism_type: str = "asgi") -> None:
event, hint = event_from_exception(
exc,
client_options=sentry_sdk.get_client().options,
mechanism={"type": mechanism_type, "handled": False},
)
sentry_sdk.capture_event(event, hint=hint)
Expand Down
1 change: 0 additions & 1 deletion sentry_sdk/integrations/asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ def _capture_exception() -> "ExcInfo":
if integration is not None:
event, hint = event_from_exception(
exc_info,
client_options=client.options,
mechanism={"type": "asyncio", "handled": False},
)
sentry_sdk.capture_event(event, hint=hint)
Expand Down
4 changes: 0 additions & 4 deletions sentry_sdk/integrations/aws_lambda.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,13 @@ def _get_user_from_event(aws_event: "dict[str, Any]") -> "dict[str, Any]":
def _wrap_init_error(init_error: "F") -> "F":
@ensure_integration_enabled(AwsLambdaIntegration, init_error)
def sentry_init_error(*args: "Any", **kwargs: "Any") -> "Any":
client = sentry_sdk.get_client()

with capture_internal_exceptions():
sentry_sdk.get_isolation_scope().clear_breadcrumbs()

exc_info = sys.exc_info()
if exc_info and all(exc_info):
sentry_event, hint = event_from_exception(
exc_info,
client_options=client.options,
mechanism={"type": "aws_lambda", "handled": False},
)
sentry_sdk.capture_event(sentry_event, hint=hint)
Expand Down Expand Up @@ -231,7 +228,6 @@ def sentry_handler(
exc_info = sys.exc_info()
sentry_event, hint = event_from_exception(
exc_info,
client_options=client.options,
mechanism={"type": "aws_lambda", "handled": False},
)
sentry_sdk.capture_event(sentry_event, hint=hint)
Expand Down
3 changes: 0 additions & 3 deletions sentry_sdk/integrations/beam.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,8 @@ def _capture_exception(exc_info: "ExcInfo") -> None:
"""
Send Beam exception to Sentry.
"""
client = sentry_sdk.get_client()

event, hint = event_from_exception(
exc_info,
client_options=client.options,
mechanism={"type": "beam", "handled": False},
)
sentry_sdk.capture_event(event, hint=hint)
Expand Down
1 change: 0 additions & 1 deletion sentry_sdk/integrations/bottle.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ def event_processor(event: "Event", hint: "dict[str, Any]") -> "Event":
def _capture_exception(exception: BaseException, handled: bool) -> None:
event, hint = event_from_exception(
exception,
client_options=sentry_sdk.get_client().options,
mechanism={"type": "bottle", "handled": handled},
)
sentry_sdk.capture_event(event, hint=hint)
1 change: 0 additions & 1 deletion sentry_sdk/integrations/celery/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ def _capture_exception(task: "Any", exc_info: "ExcInfo") -> None:

event, hint = event_from_exception(
exc_info,
client_options=client.options,
mechanism={"type": "celery", "handled": False},
)

Expand Down
2 changes: 0 additions & 2 deletions sentry_sdk/integrations/chalice.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ def __call__(self, event: "Any", context: "Any") -> "Any":
exc_info = sys.exc_info()
event, hint = event_from_exception(
exc_info,
client_options=client.options,
mechanism={"type": "chalice", "handled": False},
)
sentry_sdk.capture_event(event, hint=hint)
Expand Down Expand Up @@ -120,7 +119,6 @@ def wrapped_view_function(**function_args: "Any") -> "Any":
segment.status = SpanStatus.ERROR.value
sentry_event, hint = event_from_exception(
exc_info,
client_options=client.options,
mechanism={"type": "chalice", "handled": False},
)
sentry_sdk.capture_event(sentry_event, hint=hint)
Expand Down
1 change: 0 additions & 1 deletion sentry_sdk/integrations/cohere.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ def setup_once() -> None:
def _capture_exception(exc: "Any") -> None:
event, hint = event_from_exception(
exc,
client_options=sentry_sdk.get_client().options,
mechanism={"type": "cohere", "handled": False},
)
sentry_sdk.capture_event(event, hint=hint)
Expand Down
1 change: 0 additions & 1 deletion sentry_sdk/integrations/django/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,6 @@ def _capture_exception(

event, hint = event_from_exception(
exc_info,
client_options=sentry_sdk.get_client().options,
mechanism={"type": "django", "handled": handled},
)
sentry_sdk.capture_event(event, hint=hint)
Expand Down
1 change: 0 additions & 1 deletion sentry_sdk/integrations/dramatiq.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ def after_process_message(

event, hint = event_from_exception(
exception, # type: ignore[arg-type]
client_options=sentry_sdk.get_client().options,
mechanism={
"type": DramatiqIntegration.identifier,
"handled": False,
Expand Down
1 change: 0 additions & 1 deletion sentry_sdk/integrations/excepthook.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def sentry_sdk_excepthook(
with capture_internal_exceptions():
event, hint = event_from_exception(
(type_, value, traceback),
client_options=sentry_sdk.get_client().options,
mechanism={"type": "excepthook", "handled": False},
)
sentry_sdk.capture_event(event, hint=hint)
Expand Down
1 change: 0 additions & 1 deletion sentry_sdk/integrations/falcon.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ def sentry_patched_handle_exception(self: "falcon.API", *args: "Any") -> "Any":
if _exception_leads_to_http_5xx(ex, response):
event, hint = event_from_exception(
ex,
client_options=sentry_sdk.get_client().options,
mechanism={"type": "falcon", "handled": False},
)
sentry_sdk.capture_event(event, hint=hint)
Expand Down
1 change: 0 additions & 1 deletion sentry_sdk/integrations/flask.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ def _capture_exception(
) -> None:
event, hint = event_from_exception(
exception,
client_options=sentry_sdk.get_client().options,
mechanism={"type": "flask", "handled": False},
)

Expand Down
1 change: 0 additions & 1 deletion sentry_sdk/integrations/gcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ def sentry_func(
exc_info = sys.exc_info()
sentry_event, hint = event_from_exception(
exc_info,
client_options=client.options,
mechanism={"type": "gcp", "handled": False},
)
sentry_sdk.capture_event(sentry_event, hint=hint)
Expand Down
1 change: 0 additions & 1 deletion sentry_sdk/integrations/google_genai/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ def _capture_exception(exc: "Any") -> None:
"""Capture exception with Google GenAI mechanism."""
event, hint = event_from_exception(
exc,
client_options=sentry_sdk.get_client().options,
mechanism={"type": "google_genai", "handled": False},
)
sentry_sdk.capture_event(event, hint=hint)
Expand Down
1 change: 0 additions & 1 deletion sentry_sdk/integrations/gql.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ def sentry_patched_execute(
except TransportQueryError as e:
event, hint = event_from_exception(
e,
client_options=sentry_sdk.get_client().options,
mechanism={"type": "gql", "handled": False},
)

Expand Down
4 changes: 0 additions & 4 deletions sentry_sdk/integrations/graphene.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,9 @@ def _sentry_patched_graphql_sync(
result = old_graphql_sync(schema, source, *args, **kwargs)

with capture_internal_exceptions():
client = sentry_sdk.get_client()
for error in result.errors or []:
event, hint = event_from_exception(
error,
client_options=client.options,
mechanism={
"type": GrapheneIntegration.identifier,
"handled": False,
Expand All @@ -89,11 +87,9 @@ async def _sentry_patched_graphql_async(
result = await old_graphql_async(schema, source, *args, **kwargs)

with capture_internal_exceptions():
client = sentry_sdk.get_client()
for error in result.errors or []:
event, hint = event_from_exception(
error,
client_options=client.options,
mechanism={
"type": GrapheneIntegration.identifier,
"handled": False,
Expand Down
1 change: 0 additions & 1 deletion sentry_sdk/integrations/huey.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ def _capture_exception(exc_info: "ExcInfo") -> None:

event, hint = event_from_exception(
exc_info,
client_options=sentry_sdk.get_client().options,
mechanism={"type": HueyIntegration.identifier, "handled": False},
)
scope.capture_event(event, hint=hint)
Expand Down
1 change: 0 additions & 1 deletion sentry_sdk/integrations/huggingface_hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ def setup_once() -> None:
def _capture_exception(exc: "Any") -> None:
event, hint = event_from_exception(
exc,
client_options=sentry_sdk.get_client().options,
mechanism={"type": "huggingface_hub", "handled": False},
)
sentry_sdk.capture_event(event, hint=hint)
Expand Down
1 change: 0 additions & 1 deletion sentry_sdk/integrations/langchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ def setup_once() -> None:
def _capture_exception(exc: "Any", scope: "Optional[Any]" = None) -> None:
event, hint = event_from_exception(
exc,
client_options=sentry_sdk.get_client().options,
mechanism={"type": "langchain", "handled": False},
)
sentry_sdk.capture_event(event, hint=hint, scope=scope)
Expand Down
1 change: 0 additions & 1 deletion sentry_sdk/integrations/litellm.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ def _failure_callback(
# Capture the exception
event, hint = event_from_exception(
exception,
client_options=sentry_sdk.get_client().options,
mechanism={"type": "litellm", "handled": False},
)
sentry_sdk.capture_event(event, hint=hint)
Expand Down
1 change: 0 additions & 1 deletion sentry_sdk/integrations/litestar.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,6 @@ def exception_handler(exc: Exception, scope: "LitestarScope") -> None:

event, hint = event_from_exception(
exc,
client_options=sentry_sdk.get_client().options,
mechanism={"type": LitestarIntegration.identifier, "handled": False},
)

Expand Down
1 change: 0 additions & 1 deletion sentry_sdk/integrations/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@ def _emit(self, record: "LogRecord") -> None:
if record.exc_info and record.exc_info[0] is not None:
event, hint = event_from_exception(
record.exc_info,
client_options=client_options,
mechanism={"type": "logging", "handled": True},
)
elif (record.exc_info and record.exc_info[0] is None) or record.stack_info:
Expand Down
1 change: 0 additions & 1 deletion sentry_sdk/integrations/mcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def setup_once() -> None:
def _capture_exception(exc: "Any") -> None:
event, hint = event_from_exception(
exc,
client_options=sentry_sdk.get_client().options,
mechanism={"type": "mcp", "handled": False},
)
sentry_sdk.capture_event(event, hint=hint)
Expand Down
1 change: 0 additions & 1 deletion sentry_sdk/integrations/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ def count_tokens(self: "OpenAIIntegration", s: str) -> int:
def _capture_exception(exc: "Any") -> None:
event, hint = event_from_exception(
exc,
client_options=sentry_sdk.get_client().options,
mechanism={"type": "openai", "handled": False},
)
sentry_sdk.capture_event(event, hint=hint)
Expand Down
1 change: 0 additions & 1 deletion sentry_sdk/integrations/openai_agents/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
def _capture_exception(exc: "Any") -> None:
event, hint = event_from_exception(
exc,
client_options=sentry_sdk.get_client().options,
mechanism={"type": "openai_agents", "handled": False},
)
sentry_sdk.capture_event(event, hint=hint)
Expand Down
1 change: 0 additions & 1 deletion sentry_sdk/integrations/otlp.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ def _sentry_patched_record_exception(
with capture_internal_exceptions():
event, hint = event_from_exception(
exception,
client_options=get_client().options,
mechanism={"type": OTLPIntegration.identifier, "handled": False},
)
capture_event(event, hint=hint)
Expand Down
1 change: 0 additions & 1 deletion sentry_sdk/integrations/pydantic_ai/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ def _set_available_tools(span: "Span", agent: "Optional[Agent[Any, Any]]") -> No
def _capture_exception(exc: "Any", handled: bool = False) -> None:
event, hint = event_from_exception(
exc,
client_options=sentry_sdk.get_client().options,
mechanism={"type": "pydantic_ai", "handled": handled},
)
sentry_sdk.capture_event(event, hint=hint)
1 change: 0 additions & 1 deletion sentry_sdk/integrations/pyramid.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ def _capture_exception(exc_info: "ExcInfo") -> None:

event, hint = event_from_exception(
exc_info,
client_options=sentry_sdk.get_client().options,
mechanism={"type": "pyramid", "handled": False},
)

Expand Down
1 change: 0 additions & 1 deletion sentry_sdk/integrations/quart.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@ async def _capture_exception(

event, hint = event_from_exception(
exception,
client_options=sentry_sdk.get_client().options,
mechanism={"type": "quart", "handled": False},
)

Expand Down
3 changes: 0 additions & 3 deletions sentry_sdk/integrations/ray.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,8 @@ def _remote_method_with_header_propagation(


def _capture_exception(exc_info: "ExcInfo", **kwargs: "Any") -> None:
client = sentry_sdk.get_client()

event, hint = event_from_exception(
exc_info,
client_options=client.options,
mechanism={
"handled": False,
"type": RayIntegration.identifier,
Expand Down
3 changes: 0 additions & 3 deletions sentry_sdk/integrations/rq.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,8 @@ def event_processor(event: "Event", hint: "dict[str, Any]") -> "Event":


def _capture_exception(exc_info: "ExcInfo", **kwargs: "Any") -> None:
client = sentry_sdk.get_client()

event, hint = event_from_exception(
exc_info,
client_options=client.options,
mechanism={"type": "rq", "handled": False},
)

Expand Down
1 change: 0 additions & 1 deletion sentry_sdk/integrations/sanic.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ def _capture_exception(exception: "Union[ExcInfo, BaseException]") -> None:
with capture_internal_exceptions():
event, hint = event_from_exception(
exception,
client_options=sentry_sdk.get_client().options,
mechanism={"type": "sanic", "handled": False},
)

Expand Down
1 change: 0 additions & 1 deletion sentry_sdk/integrations/serverless.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ def _capture_and_reraise() -> None:
if client.is_active():
event, hint = event_from_exception(
exc_info,
client_options=client.options,
mechanism={"type": "serverless", "handled": False},
)
sentry_sdk.capture_event(event, hint=hint)
Expand Down
1 change: 0 additions & 1 deletion sentry_sdk/integrations/starlette.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ def _default(value: "Any") -> "Any":
def _capture_exception(exception: BaseException, handled: "Any" = False) -> None:
event, hint = event_from_exception(
exception,
client_options=sentry_sdk.get_client().options,
mechanism={"type": StarletteIntegration.identifier, "handled": handled},
)

Expand Down
1 change: 0 additions & 1 deletion sentry_sdk/integrations/starlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ def exception_handler(exc: Exception, scope: "StarliteScope", _: "State") -> Non

event, hint = event_from_exception(
exc,
client_options=sentry_sdk.get_client().options,
mechanism={"type": StarliteIntegration.identifier, "handled": False},
)

Expand Down
1 change: 0 additions & 1 deletion sentry_sdk/integrations/strawberry.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,6 @@ def _sentry_patched_handle_errors(
for error in errors:
event, hint = event_from_exception(
error,
client_options=sentry_sdk.get_client().options,
mechanism={
"type": StrawberryIntegration.identifier,
"handled": False,
Expand Down
1 change: 0 additions & 1 deletion sentry_sdk/integrations/sys_exit.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ def sentry_patched_exit(__status: "Union[str, int, None]" = 0) -> "NoReturn":
def _capture_exception(exc: "SystemExit") -> None:
event, hint = event_from_exception(
exc,
client_options=sentry_sdk.get_client().options,
mechanism={"type": SysExitIntegration.identifier, "handled": False},
)
sentry_sdk.capture_event(event, hint=hint)
Loading
Loading