term$ libreoffice --headless --convert-to pdf --outdir /tmp/ /corrupted/or/invalid/file/path.doc
When the file to convert is corrupted, no error messages are sent. Even if the file do not exists, no errors are returned. And the badest part is that the return code will every be: "0", aka: no error.
This is really confusing, and makes the feature dificultly usable inside shell scripts.
Steps to reproduce:
libreoffice --headless --convert-to pdf --outdir /tmp /UNEXISTING/PATH
libreoffice --headless --convert-to pdf --outdir /tmp /CORRUPTED/DOC
As I indicated in this comment:
... tests under various versions (from v3.3 to v4.1) reveal that LO has likely never exited with anything other than a zero return code for the test provided here (file does not exist or cannot be converted). Version set to Inherited From OOo. Severity set to enhancement.
The same matter has also been raised on the mailing list in 2012-11:
Therefore confirmed (seems worthwhile for scripting). Status set to NEW. Summary edited for greater clarity.
Setting version back from "Inherited From OOo" to what it was prior (for bugs marked enhancement), for QA tracking purposes. My mistake. Apologies.
This feature is still missing in LO 4.0.x
it would be useful to have different exit code for
- unexisting file or path
- access denied
- corrupted/encrypted file