zettle: print paths with invalid frontmatter instead of crashing
1 files changed, 6 insertions(+), 1 deletions(-) M modules/zettle/zettle.py
M modules/zettle/zettle.py => modules/zettle/zettle.py +6 -1
@@ 130,7 130,12 @@ def extract_frontmatter(path): if in_frontmatter: frontmatter_raw += line + "\n" frontmatter = yaml.safe_load(frontmatter_raw) frontmatter = None try: frontmatter = yaml.safe_load(frontmatter_raw) except Exception as e: sys.stderr.write("Failed to load frontmatter from path: '{}': {}\n".format(path, e)) if frontmatter is None: frontmatter = {} return frontmatter