Skip to content
Permalink
Browse files

Better error messaging

  • Loading branch information...
ralsina committed May 28, 2017
1 parent 7672b57 commit 03b285ff21866652990e263ae3f50cb52a30134e
Showing with 2 additions and 1 deletion.
  1. +2 −1 nikola/post.py
@@ -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

0 comments on commit 03b285f

Please sign in to comment.
You can’t perform that action at this time.