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

Produce some useful error before exiting when a channel does not exist #697

Open
LambdaPaul opened this issue May 6, 2022 · 8 comments
Open
Labels
good first issue Good for newcomers

Comments

@LambdaPaul
Copy link
Contributor

Need some sort of null check for the channel during bot init.

@LambdaPaul
Copy link
Contributor Author

Forgot to mention that this is not an issue locally but on docker/podman.

@LambdaPaul
Copy link
Contributor Author

Correction, during prod mode.

@tanndlin
Copy link
Collaborator

tanndlin commented May 6, 2022

This is intended, a design decision I made a while ago. Since Lion is run on a server of a static set of channels and only intended for the UCF CS server.

The other alternative is to null check every time we need to look up a channel, which is unnecessary since each test server should be made off the template

@LambdaPaul
Copy link
Contributor Author

I only made this issue because for the other channels it does not seem to care and shoots only a warning log instead of straight up crashing without saying why.

@tanndlin
Copy link
Collaborator

tanndlin commented May 6, 2022

I only made this issue because for the other channels it does not seem to care and shoots only a warning log instead of straight up crashing without saying why.

It's doing that because when you change to production mode, the bot try's to call GuildService.getChannel for the GitHub channel

If you use any plugin/handler that requires this, the same will happen for any other channel

I do agree there should be a warning, and an error thrown, but I do not want to have to null check.

@LambdaPaul
Copy link
Contributor Author

Maybe not a null check, but some sort of logging would suffice in case there is an accidental deletion of a channel.

@c650
Copy link
Collaborator

c650 commented May 8, 2022

yeah it would be nice to say "expected channel to exist" or something? hopefully we catch a toplevel exception for it. someone else can tal though

@tanndlin tanndlin added the good first issue Good for newcomers label Aug 31, 2023
@tanndlin tanndlin changed the title Bot crashes without warning if #lion_project_github does not exist Produce some useful error before exiting when a channel does not exist Aug 31, 2023
@tanndlin
Copy link
Collaborator

Would be some simple one liner here

Currently the bot just asserts the type instead of null checking

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

3 participants