Catch UnicodeDecodeError Error (#4007)
* Catch UnicodeDecodeError Error Error for #3933 * Forgot (exc) * catch... * Tests by @lwis * Docstring * Create open
This commit is contained in:
parent
1f89e6ddba
commit
5df8477536
2 changed files with 10 additions and 4 deletions
|
@ -43,6 +43,9 @@ def load_yaml(fname: str) -> Union[List, Dict]:
|
|||
except yaml.YAMLError as exc:
|
||||
_LOGGER.error(exc)
|
||||
raise HomeAssistantError(exc)
|
||||
except UnicodeDecodeError as exc:
|
||||
_LOGGER.error('Unable to read file %s: %s', fname, exc)
|
||||
raise HomeAssistantError(exc)
|
||||
|
||||
|
||||
def clear_secret_cache() -> None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue