htdebeer / pandocomatic

Automate the use of pandoc

Home Page:https://heerdebeer.org/Software/markdown/pandocomatic/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

An unexpected error has occurred

bambam42 opened this issue · comments

I have pandoc setup in a folder and it scans for markdown documents in subfolders to convert.
One of those documents probably has invalid markdown in it (something like '----'). This results in an error (like below).
Usually I will remove the folders one-by-one until the script runs fine again and then fix the error and put everything back in it's place.

The reason I do this, is because the presented error does not offer me clues on the context of what file is being processed. Maybe this is something that could be fixed on the logging side, if not I will use my work-around.

pandocomatic --version
Pandocomatic version 1.1.0
© 2014—2021 Huub de Beer huub@heerdebeer.org

Pandocomatic is free software; pandocomatic is released under the GPLv3.

For more information about pandocomatic run 'pandocomatic --help' or read
pandocomatic's manual at https://heerdebeer.org/Software/markdown/pandocomatic/.

[UNEXPECTED ERROR] An unexpected error has occurred. You can report this bug via https://github.com/htdebeer/pandocomatic/issues/new.
/Library/Ruby/Gems/2.6.0/gems/psych-4.0.3/lib/psych.rb:455:in parse': (<unknown>): could not find expected ':' while scanning a simple key at line 19 column 1 (Psych::SyntaxError) from /Library/Ruby/Gems/2.6.0/gems/psych-4.0.3/lib/psych.rb:455:in parse_stream'
from /Library/Ruby/Gems/2.6.0/gems/psych-4.0.3/lib/psych.rb:399:in parse' from /Library/Ruby/Gems/2.6.0/gems/psych-4.0.3/lib/psych.rb:324:in safe_load'
from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-1.1.0/lib/pandocomatic/pandocomatic_yaml.rb:44:in load' from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-1.1.0/lib/pandocomatic/pandoc_metadata.rb:198:in block in initialize'
from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-1.1.0/lib/pandocomatic/pandoc_metadata.rb:198:in map' from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-1.1.0/lib/pandocomatic/pandoc_metadata.rb:198:in initialize'
from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-1.1.0/lib/pandocomatic/pandoc_metadata.rb:188:in new' from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-1.1.0/lib/pandocomatic/pandoc_metadata.rb:188:in extract_metadata'
from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-1.1.0/lib/pandocomatic/pandoc_metadata.rb:62:in load' from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-1.1.0/lib/pandocomatic/pandoc_metadata.rb:51:in load_file'
from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-1.1.0/lib/pandocomatic/command/convert_file_multiple_command.rb:52:in initialize' from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-1.1.0/lib/pandocomatic/command/convert_dir_command.rb:91:in new'
from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-1.1.0/lib/pandocomatic/command/convert_dir_command.rb:91:in block in initialize' from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-1.1.0/lib/pandocomatic/command/convert_dir_command.rb:72:in foreach'
from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-1.1.0/lib/pandocomatic/command/convert_dir_command.rb:72:in initialize' from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-1.1.0/lib/pandocomatic/command/convert_dir_command.rb:85:in new'
from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-1.1.0/lib/pandocomatic/command/convert_dir_command.rb:85:in block in initialize' from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-1.1.0/lib/pandocomatic/command/convert_dir_command.rb:72:in foreach'
from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-1.1.0/lib/pandocomatic/command/convert_dir_command.rb:72:in initialize' from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-1.1.0/lib/pandocomatic/command/convert_dir_command.rb:85:in new'
from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-1.1.0/lib/pandocomatic/command/convert_dir_command.rb:85:in block in initialize' from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-1.1.0/lib/pandocomatic/command/convert_dir_command.rb:72:in foreach'
from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-1.1.0/lib/pandocomatic/command/convert_dir_command.rb:72:in initialize' from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-1.1.0/lib/pandocomatic/pandocomatic.rb:85:in new'
from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-1.1.0/lib/pandocomatic/pandocomatic.rb:85:in run' from /Library/Ruby/Gems/2.6.0/gems/pandocomatic-1.1.0/bin/pandocomatic:3:in <top (required)>'
from /usr/local/bin/pandocomatic:23:in load' from /usr/local/bin/pandocomatic:23:in

'

It can be reproduced with the following code in the markdown source.

Unexpected Markdown Error.md

Thanks for logging a bug report! I think your issue is a duplicate of #113. If so, you can resolve it with: this change.