mobarena / MobArenaStats

An extension plugin for MobArena that collects arena session stats.
GNU General Public License v3.0
3 stars 2 forks source link

Improve error handling in commands when startup fails #10

Open garbagemule opened 3 years ago

garbagemule commented 3 years ago

A misconfiguration in the plugin or the chosen data store will result in an error somewhere in the startup process. Because the commands are set up before the stats store is initialized, the commands can still run even though the initialization fails (this is good, because it gives us a way to report issues inside the commands).

To test this out, try spinning up the plugin with an invalid store type like type: foo, then run a command like /ma global-stats.

All commands currently assume the stats store is non-null, and in the case of a failed initialization, that assumption is wrong. It would be a good idea to make the commands check for this and report some sort of generic No stats store configured. Check the server log for errors. error message.