Skip to content

Reminders empty message fix - #64

Merged
Nickster258 merged 2 commits into
OpenRedstoneEngineers:mainfrom
sebkuip:Reminders-empty-message-fix
Aug 15, 2026
Merged

Reminders empty message fix#64
Nickster258 merged 2 commits into
OpenRedstoneEngineers:mainfrom
sebkuip:Reminders-empty-message-fix

Conversation

@sebkuip

@sebkuip sebkuip commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Reminders crash when an empty reminder messages is provided. Now instead it defaults to a standard text to stop the error.
I've also added some error handling specifically to the loop, which logs the error and attempts to restart the loop.

Comment thread cogs/reminders.py
self.check_reminders.cancel() # Stop the task to prevent further errors
except Exception as e:
self.bot.logger.error(f"Failed to cancel check_reminders task: {e}")
self.check_reminders.start() # Restart the task

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.

Couldn't there possibly be errors given when you try to restart the reminders? I'd wrap this line in a try-except too, because if I'm not mistaken that could crash it otherwise?! I don't see too many ways how the function would cause errors, but it might be better to guard against them anyways?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In that case, it would fall back into this same error handler again. This would just cause log spam worst case as it's constantly trying to restart and error out again.

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.

Idk if that will mean it's gonna cause infinite recursion (which might be a problem). Maybe we could add some recursion-limit decorator or similar, so it doesn't try again after 1000 fails, and pings Nick and Capo then?! (Forgot to post this comment lol)

@Nickster258
Nickster258 merged commit b517aa8 into OpenRedstoneEngineers:main Aug 15, 2026
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