Skip to content

Extension Load Error Detection & Tracking #3

@a-runebou

Description

@a-runebou

Summary

Implement centralized detection of extension (cog) load failures during bot startup (and reloads?). Currently, failures may occur silently because extension loading is scheduled asynchronously, and exceptions are not surfaced clearly.

  1. load_extensions() schedules tasks.
  2. Exceptions occur inside async tasks.
  3. Failures may only appear in logs/Sentry.
  4. The bot may run partially degraded without moderator awareness.

Tasks

  • Wrap Bot.load_extension() in try/except.
  • Catch any errors.
  • Track extension that failed to load.
  • Unit test for failure detection.

Related

The methods load_extensions() and _load_extensions() are relevant and might need to be overwritten: https://github.com/python-discord/bot-core/blob/74072b3709d87dc811a4972aec1ef172101e49bf/pydis_core/_bot.py#L163

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions