Skip to content

Commit

Permalink
fix. Improved robustness wrt non-YAML files.
Browse files Browse the repository at this point in the history
  • Loading branch information
tamere-allo-peter committed Mar 24, 2022
1 parent 6d3659d commit bbf1da2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions yamlfixer/filefixer.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ def load(self):
self.incontents = yamlfile.read()
except FileNotFoundError as msg:
self.yfixer.error(f"{msg}")
except UnicodeDecodeError as msg:
self.yfixer.error(f"{self.filename} doesn't seem to be YAML : {msg}")

def dump(self, outcontents):
"""Dumps the new file's contents."""
Expand Down

0 comments on commit bbf1da2

Please sign in to comment.