Skip to content

Commit fcfe5f5

Browse files
committed
🐛 Fix patches not loading
1 parent 2609653 commit fcfe5f5

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/extensions/nice_errors/handlers/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ async def handle_error(
9797
)
9898
if handled:
9999
return
100-
if report and use_sentry_sdk and sentry_sdk:
100+
if report and use_sentry_sdk:
101101
out = sentry_sdk.capture_exception(error)
102102
message += f"\n\n-# {translations.reported_to_devs} - `{out}`"
103103
await ctx.respond(message, **sendargs)

src/extensions/nice_errors/patch.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@
33

44
from typing import TYPE_CHECKING, Any
55

6+
from src.log import logger as base_logger
7+
68
from .handlers import error_handler
79

10+
logger = base_logger.getChild("nice_errors")
11+
812

913
async def patch(config: dict[str, Any]) -> None:
1014
sentry_sdk = None
@@ -29,6 +33,7 @@ async def patch(config: dict[str, Any]) -> None:
2933
pii_denylist=[*DEFAULT_PII_DENYLIST, "headers", "kwargs"],
3034
),
3135
)
36+
logger.success("Sentry SDK initialized")
3237

3338
from discord.ui import View
3439

src/patcher.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ async def load_and_run_patches() -> None:
2121
its_config: dict[Any, Any] = {}
2222
if its_config := (
2323
config["extensions"].get(extension, config["extensions"].get(extension.replace("_", "-"), {}))
24-
) and its_config.get("enabled", False):
24+
):
25+
if not its_config.get("enabled", False):
26+
continue
2527
logger.info(f"Loading patch for extension {extension}")
2628
spec = importlib.util.spec_from_file_location(f"src.extensions.{extension}.patch", patch_file)
2729
if not spec or not spec.loader:

0 commit comments

Comments
 (0)