Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option --fail-if-warnings has no effect for writer warnings when converting to PDF via LaTeX #5343

Closed
tarleb opened this issue Mar 1, 2019 · 0 comments

Comments

@tarleb
Copy link
Collaborator

tarleb commented Mar 1, 2019

The following command returns with the expected error code 3

$ echo '![](does-not-exist.jpg)' | pandoc -t docx -o /dev/null --fail-if-warnings
[WARNING] Could not fetch resource 'does-not-exist.jpg': PandocResourceNotFound "does-not-exist.jpg"
Failing because there were warnings.
$ echo $?
3

However, when converting to PDF via LaTeX, pandoc will signal success despite producing warnings:

$ echo '![](does-not-exist.jpg)' | pandoc -o /tmp/delete-me.pdf --fail-if-warnings
[WARNING] Could not fetch resource 'does-not-exist.jpg': replacing image with description
$ echo $?
0

Behavior is as expected whenever warnings are created by the reader:

$ echo '\include{does-not-exist.tex}' | pandoc -f latex -o /tmp/delete-me.pdf --fail-if-warnings
[WARNING] Could not load include file 'does-not-exist.tex' at line 1 column 29
Failing because there were warnings.
$ echo $?
3

It stands to argue that all of the above commands should fail.

@tarleb tarleb changed the title Option --fail-if-warnings has no effect when converting to PDF via LaTeX Option --fail-if-warnings has no effect for writer warnings when converting to PDF via LaTeX Mar 1, 2019
@jgm jgm closed this as completed in 89ccbc1 Mar 1, 2019
jgm added a commit that referenced this issue Mar 1, 2019
...to allow warnings to be threaded through.

Additional fix for #5343.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant