From a733e2a3f6d2f3b9607b6c695ef73d3442af2f38 Mon Sep 17 00:00:00 2001 From: Greg Wilson Date: Wed, 22 Jun 2016 13:17:02 -0400 Subject: [PATCH] Raising exception instead of printing error on bad YAML --- bin/util.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/util.py b/bin/util.py index 23245be..cb85cf2 100644 --- a/bin/util.py +++ b/bin/util.py @@ -68,8 +68,7 @@ def read_markdown(parser, path): try: metadata = yaml.load(pieces[1]) except yaml.YAMLError as e: - print('Unable to parse YAML header in {0}:\n{1}'.format(path, e)) - sys.exit(1) + raise ValueError('Unable to parse YAML header in {0}:\n{1}'.format(path, e)) metadata_len = pieces[1].count('\n') body = pieces[2]