amyreese / markdown-pp

Preprocessor for Markdown files to generate a table of contents and other documentation needs
MIT License
309 stars 68 forks source link

An `!INCLUDE` of a file that is not found should print an error to stderr and exit with non-zero status code #36

Open tswast opened 7 years ago

tswast commented 7 years ago

I just bumped into https://github.com/jreese/markdown-pp/issues/10 where the path is relative to the current working directory instead of being relative to the file path. The result was blank spaces in my document where the !INCLUDE module directives were.

The app should print an error (to stderr) and exit with a failure status code in this case.

tswast commented 7 years ago

I started investigating this more today. Are you okay with letting modules throw an IOError on errors? I figure it makes more sense to do that than have modules do sys.exit(1).

Do we need to add a flag to keep the default behavior of ignoring errors?

amyreese commented 7 years ago

A flag would be nice to have. I don't have an opinion either way on how to display errors.