napari / midi-app-controller

Control napari with a MIDI controller.
BSD 3-Clause "New" or "Revised" License
1 stars 3 forks source link

Make autoloading more robust to bad yaml files #114

Closed jni closed 1 week ago

jni commented 2 weeks ago

Having an incorrect yaml file in the default paths (root dir and config dir) can cause the plugin to crash completely. I ran into this in #104, which was particularly bad because the plugin wrote the inconsistent file in the first place. However, there's many reasons why bad yaml might exist in the default directories, including:

Non-yaml files are already ignored, so I don't think it's a big difference if we also ignore invalid yaml files. Until we provide utilities to clean up the directories, I think robustness to bad input is very important.

In this PR, if we encounter any error while loading all models from given directories, we ignore the error and move on to the next file.