Skip to content

Commit

Permalink
Adds file information the error message
Browse files Browse the repository at this point in the history
  • Loading branch information
menganha committed Dec 12, 2022
1 parent c2953a0 commit a47560d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions yabi/post.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ def parse_metadata(self) -> dict[str, str]:
# Check for errors
missing_mandatory_labels = set(Post.MANDATORY_LABELS).difference(set(metadata))
if missing_mandatory_labels:
raise ValueError(f'The following mandatory label(s) is missing: {missing_mandatory_labels}')
raise ValueError(f'The following mandatory label(s) is missing for the file {self.source_path}: {missing_mandatory_labels}')
elif 'title' not in metadata:
raise ValueError('No title found after the data labels')
raise ValueError(f'No title found after the data labels for the file {self.source_path}')

# Convert into the correct type the value of the keys
for key, value in metadata.items():
Expand Down

0 comments on commit a47560d

Please sign in to comment.