-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make autoloading more robust to bad yaml files (#114)
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: - user incorrectly edits a file - the schema changes - valid action IDs change - the version of the plugin changes (schema and paths aren't pinned to versions) 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.
- Loading branch information
Showing
2 changed files
with
53 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters