Skip to content

Fix Discord presence module error handling (Fixes #5535) #5568

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

claudecodebyia
Copy link

Summary

This PR adds proper error handling to the Discord Presence module to fix issue #5535 where Discord presence would fail silently when Discord is not running or when the connection fails.

Changes Made

  • Added try-catch blocks around all Discord IPC operations (start(), stop(), and setActivity())
  • Added informative error messages to help users understand why the module failed
  • Module now automatically disables itself when connection fails
  • Added a flag to prevent spam of repeated error messages

Technical Details

The issue was caused by the Discord IPC library throwing exceptions when:

  1. Discord is not running
  2. Discord's IPC socket is not accessible
  3. Connection to Discord fails for any reason

Previously, these exceptions would crash the module without any user feedback. Now the module handles these gracefully and provides clear error messages.

Test Plan

  • Enable Discord Presence module when Discord is not running
  • Verify error message appears and module auto-disables
  • Start Discord and re-enable the module
  • Verify Discord presence works correctly
  • Close Discord while module is running
  • Verify module handles disconnection gracefully

🤖 This analysis and fix was performed by Claude Opus 4 AI model

Co-Authored-By: Claude [email protected]

- Added try-catch blocks around Discord IPC calls to prevent crashes
- Added informative error messages when Discord is not running
- Module now automatically disables itself on connection failure
- Prevents spam of repeated error messages

This fixes issue MeteorDevelopment#5535 where Discord presence would fail silently
when Discord is not running or connection fails.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@RacoonDog
Copy link
Collaborator

🥀

@Big-Iron-Cheems
Copy link
Collaborator

This is so ass, doean't really do anything apart from logging.

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.

3 participants