codinglab-io / discord-bot

Discord bot for Codinglab's server.
https://discord.com/invite/codinglab-174169014568878080
MIT License
19 stars 14 forks source link

Modules throws crash the whole bot. #59

Open neolectron opened 1 year ago

neolectron commented 1 year ago

Today a module had crashed the whole bot.

I thought that the throw boundary was scoped to the client.on but maybe not. We should check this. image

I don't want to FORCE users to catch inside modules, although it's a good practice, a module should only crash itself. Bonus if it goes into disabled state after crashing.

ayoubqrt commented 11 months ago

Are you sure about this ? I wanted to open an issue about that all the errors are silenced in the modules

neolectron commented 11 months ago

What do you mean by silenced by the module ?

Do you have an example?

ayoubqrt commented 11 months ago

For example, if I throw voluntarily in a event handler in a module, I see no errors in the console, so the debug is impossible

image
potb commented 11 months ago

It happened today, again. This time, it was because of a missing environment variable.

There is room for improvement regarding environment variables handling and error boundaries for modules.