openmotics / plugins

Repository containing the gateway plugins.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exceptions in __init__ fails loading plugin

khenderick opened this issue · comments

No exceptions should occur during init of a plugin. If one is raised, the plugin fails to load and won't be running/used.

Code that might fail (e.g. API calls) should be separated in a different thread that can re-try every X time. This will at least cause the plugin to start (but might be disabled), and be auto-enable once the code succeeds. Even if it's a unrecoverable issue, catching the error and logging it will allow the user to actually see the error.