Reminders empty message fix - #64
Conversation
| 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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)
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.