modmailbot
modmailbot copied to clipboard
Better error messages when permissions are missing
Hi there, first time for me posting in this github repo, but I found a bug with modmail threads specifically about denied permissions when the requisite function is invoked.
The below are steps to reproduce this with Manage Messages being denied, but could be applied to anything that would cause Error: Missing Permissions to be logged in your error logs.
The general premise of this ticket should be to show more verbose/clearer error messages when attempting to do an action that won't run.
Steps to Reproduce:
- Set up a selfhosted instance
- Invite the bot to your server but don't provide Manage Messages
- Invoke a command that would result in a call to delete the invokers message
- Observe
Expected Result: The bot stays up despite the missing permissions Actual Result: The bot crashes out because it doesn't have a catch for the missing perm.
Hope this can be resolved! Obviously the permissions should be there, but for those like me who completely miss that a perm is needed, it would be good to have more clear error logs. :D
This is functioning as designed. It is not desirable to have the bot appear online but non-functional. If you were inattentive, the bot showing offline on the server would let you know to check the logs to correct the issue. v / r Robert Klebes Mobile: 571-492-8639 https://keybase.io/sporkwitch https://www.linkedin.com/in/klebes
On June 13, 2020 3:26:02 PM EDT, Sajuuk [email protected] wrote:
Hi there, first time for me posting in this github repo, but I found a bug with modmail threads specifically about denied permissions when the requisite function is invoked.
The below are steps to reproduce this with Manage Messages being denied, but could be applied to anything that would cause Error: Missing Permissions to be logged in your error logs.
The general premise of this ticket should be to show more verbose/clearer error messages when attempting to do an action that won't run.
Steps to Reproduce:
- Set up a selfhosted instance
- Invite the bot to your server but don't provide Manage Messages
- Invoke a command that would result in a call to delete the invokers message
- Observe
Expected Result: The bot stays up despite the missing permissions Actual Result: The bot crashes out because it doesn't have a catch for the missing perm.
Hope this can be resolved! Obviously the permissions should be there, but for those like me who completely miss that a perm is needed, it would be good to have more clear error logs. :D
-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/Dragory/modmailbot/issues/400
This could definitely use improvements. Either the error messages need to include a stack trace (there's a bug here that will be fixed soon) or otherwise be more descriptive, or the errors should be handled on the bot's side. But the current situation where the only error you get is "Missing Permissions" without a stack trace or other context is not ideal.
I concur. Optimal would be reporting e. g. "Missing Manage Channels permission in category