Skip to content

Commit

Permalink
Better error messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
ralsina committed May 28, 2017
1 parent 7672b57 commit 03b285f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nikola/post.py
Expand Up @@ -1030,7 +1030,8 @@ def _get_metadata_from_file(meta_data):
# If 1st line is '---', then it's YAML metadata
if meta_data[0] == '---':
if yaml is None:
utils.req_missing('pyyaml', 'use YAML metadata')
utils.req_missing('pyyaml', 'use YAML metadata', optional=True)
raise ValueError('Error parsing metadata')
idx = meta_data.index('---', 1)
meta = yaml.load('\n'.join(meta_data[1:idx]))
# We expect empty metadata to be '', not None
Expand Down

0 comments on commit 03b285f

Please sign in to comment.