Skip to content

Implement DiscordGateway503Filter for logging - #96

Merged
Twilights-0 merged 5 commits into
mainfrom
fix/discord-gateway-503
Aug 18, 2026
Merged

Twilights-0 merged 5 commits into
mainfrom
fix/discord-gateway-503

Conversation

@Twilights-0

Copy link
Copy Markdown
Contributor

Added a logging filter to handle Discord Gateway 503 errors.

Added a logging filter to handle Discord Gateway 503 errors.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a targeted logging filter to suppress noisy Discord gateway “503 Service Unavailable” handshake warnings and replace them with a single cleaner warning emitted by the application logger.

Changes:

  • Introduces DiscordGateway503Filter to detect Discord gateway 503 handshake failures and rewrite the log output.
  • Registers the filter on the discord.client logger during main() startup.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/fablabot/main.py Outdated
Comment thread src/fablabot/main.py
Comment thread src/fablabot/main.py Outdated
Comment thread src/fablabot/main.py Outdated
Twilights-0 and others added 4 commits August 18, 2026 18:41
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Suppressed comments (1)

src/fablabot/main.py:58

  • Logging a new message from inside a logging filter adds side effects and can lead to confusing ordering or re-entrancy issues. Since the goal is just to de-noise this specific 503 warning, it’s safer to rewrite the existing record (and clear exc_info) and let the original logger emit it, rather than emitting a second log and returning False.
            logger.warning(
                "Discord Gateway indisponible (503). %s",
                retry_message,
            )

@Twilights-0
Twilights-0 merged commit 8900105 into main Aug 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants