We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 05fcbb1 commit 7595305Copy full SHA for 7595305
src/extensions/nice_errors/patch.py
@@ -12,7 +12,7 @@
12
13
async def patch(config: dict[str, Any]) -> None:
14
sentry_sdk = None
15
- if config.get("sentry", {}).get("dsn"):
+ if (sentry_config := config.get("sentry", {})).get("dsn"):
16
import sentry_sdk # noqa: PLC0415
17
from sentry_sdk.integrations.asyncio import AsyncioIntegration # noqa: PLC0415
18
from sentry_sdk.integrations.logging import LoggingIntegration # noqa: PLC0415
@@ -23,7 +23,8 @@ async def patch(config: dict[str, Any]) -> None:
23
)
24
25
sentry_sdk.init(
26
- dsn=config["sentry"]["dsn"],
+ dsn=sentry_config["dsn"],
27
+ environment=sentry_config.get("environment", "production"),
28
integrations=[
29
AsyncioIntegration(),
30
LoggingIntegration(),
0 commit comments