fix: Handle UNKNOWN_MESSAGE exception in SuggestionsUpDownVoter by Bryce72 · Pull Request #1415 · Together-Java/TJ-Bot
Conversation
Fixes #1414
When a spam message is posted in the suggestions channel, both ScamBlocker and SuggestionsUpDownVoter react to it. If ScamBlocker deletes the message first, SuggestionsUpDownVoter throws an ErrorResponseException [10008] (UNKNOWN_MESSAGE) when trying to create a thread or react.
This PR explicitly handles that exception and logs it as INFO instead of ERROR, since it's expected behavior.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't know for a fact that message was deleted by scamBlocker(most likely yes) but it's a good idea to keep things more to the point. We only know message was no longer available so we stick to that.
…ly with an INFO log instead Together-Java#1414 Refactored and idomaticized -- oops updated to make sure its similar via both react and create thread
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters