Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] MongoDB error-handling #154

Open
vitasenka opened this issue Oct 28, 2020 · 3 comments
Open

[BUG] MongoDB error-handling #154

vitasenka opened this issue Oct 28, 2020 · 3 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@vitasenka
Copy link
Contributor

The bot replies with success message even if MongoDB server is not available.

How to produce the bug:

  1. Start MongoDB server.
  2. Start the bot.
  3. Shutdown the MongoDB server.
  4. Use bot commands.

catchBug

@vitasenka vitasenka added the bug Something isn't working label Oct 28, 2020
@RazCrimson
Copy link
Contributor

Yes, I can reproduce this. The reply from bot takes some time(30seconds) which is probably when the request to DB times out.

@rgroves rgroves added the help wanted Extra attention is needed label Oct 30, 2020
@RazCrimson
Copy link
Contributor

@rgroves We can stop the bot when the DB gets disconnected the connection times out?

@rgroves
Copy link
Collaborator

rgroves commented Oct 31, 2020

LIstBot needs better error handling. In some places, especially in most commands when interacting with the database, it's non-existent.

I think it would be good to have two things done in starting to address this issue, and this probably needs some further examination of the codebase to see exactly what needs doing, but in general:

  1. Allow user to make connection timeout configurable—meaning they can lower the timeout value by overriding in the .env file. (this will make testing easier as well, so you won't need to wait the full 30 second default timeout).

  2. Add try...catch blocks where needed in the commands so that we can capture, log, and report back a clear message to bot users when there is an issue.

This is something that definitely should be addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants