NyaaCat / NyaaCore

Code infrastructure for all NyaaCat plugins
MIT License
22 stars 12 forks source link

Check config before reload #30

Open phoenixlzx opened 6 years ago

phoenixlzx commented 6 years ago

Provide a method for plugin reload commands.

Check all config files for YAML validity and some specific constant values before the actual reload, report error position and stop to prevent any data loss.

RecursiveG commented 6 years ago

Not so practical. Only the plugin itself knows how to check the integrity. YAML syntax check is all we can do.

phoenixlzx commented 6 years ago

Actually YAML syntax is the most common cause of crash.

As for plugin-related constants, we simply reset to default value in memory to continue running, when no valid value found in configuration - without write into config files and notify in the console.