update yaml format to use new exception handling

This commit is contained in:
Jonathan Wren 2022-05-01 03:43:29 -07:00
parent 7eb385d0bb
commit 6945d6a535

View file

@ -25,10 +25,7 @@ class YAMLExporter(TextExporter):
def export_entry(cls, entry, to_multifile=True):
"""Returns a markdown representation of a single entry, with YAML front matter."""
if to_multifile is False:
raise RuntimeError(
f"{ERROR_COLOR}ERROR{RESET_COLOR}: YAML export must be to individual files. Please \
specify a directory to export to."
)
raise JrnlException(Message(MsgText.YamlMustBeDirectory, MsgType.ERROR))
date_str = entry.date.strftime(entry.journal.config["timeformat"])
body_wrapper = "\n" if entry.body else ""