Skip to content

Commit

Permalink
Catch !includes with unfound files
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasloven committed Aug 8, 2019
1 parent eeb483d commit ecbacde
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion custom_components/lovelace_gen/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ def load_yaml(fname, args={}):
except loader.yaml.YAMLError as exc:
_LOGGER.error(str(exc))
raise HomeAssistantError(exc)
except UnicodeDecodeError as exc:
except (UnicodeDecodeError, FileNotFoundError) as exc:
_LOGGER.error("Unable to read file %s: %s", fname, exc)
raise HomeAssistantError(exc)


def _include_yaml(ldr, node):
args = {}
if isinstance(node.value, str):
Expand Down

0 comments on commit ecbacde

Please sign in to comment.