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

Error handling in DiscordBotStartupService #17

Open
fpindej opened this issue Feb 1, 2024 · 1 comment
Open

Error handling in DiscordBotStartupService #17

fpindej opened this issue Feb 1, 2024 · 1 comment
Labels
good first issue Good for newcomers

Comments

@fpindej
Copy link
Owner

fpindej commented Feb 1, 2024

Problem

When the bot starts here, You are at mercy of everything being set up correctly. That's far from optimal.

Solution suggestion

  • try-catch in await _client.LoginAsync(TokenType.Bot, _clientToken); and await _client.StartAsync();
  • log a valid error message
  • either introduce some retry mechanism or end the application gracefully
@fpindej fpindej added the good first issue Good for newcomers label Feb 1, 2024
@fpindej
Copy link
Owner Author

fpindej commented Mar 14, 2024

Big problem with this is that the Discord.NET library isn't exactly friendly and logs the exception instead of throwing it. Will have to figure this one out later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant