Bravo555 / neomason-discord-bot

A bot for a friend's Discord server (Neo-Masonic Internationale)
0 stars 0 forks source link

Reduce amount of unwraps, dont panic on errors #6

Open Bravo555 opened 4 years ago

Bravo555 commented 4 years ago

I want to have more granularity in terms of handling the errors.

  1. don't panic when a command payload fails; keep running instead but provide information that command failed
  2. when it's a high level command error, such as: bad arguments, command malformed, etc. run a high level error handler that sends an information about the error to the server
  3. when it's a relatively low-level error, such as: can't get a thing from the database, failed to insert a thing into a database, etc. log it properly, maybe send a DM to bot authors, informing that the bot is in an unexpected state.
  4. panic only as a last resort