Headless LibreOffice fails with zero status code?

I’m trying to develop a wrapper around the LibreOffice command line interface to convert some files to the PDF format, but when an error occurs, a zero status code is returned:

As you can see in the above image, although an error has occurred, a zero status code was returned.

I would expect that this kind of error should return a status code greater or equal 1, which is not the case. Is there an option or something to “fix” that?

And what should be the error code if several filenames were provided, and some failed, some succeeded converting?

(I’m not telling it’s OK; just asking your opinion.)

Generally that better filed to bug tracker. In case when all files failed, we should likely return error; and even for some failed, maybe something like “some failed”; no idea how would it affect existing scripts…

I only think that return zero is not a “right” thing to do in that specific situation, as a zero-status indicates that everything went well, which is not the case. So, I would use any status greater than zero. :slight_smile:

So when you file the bug, please mention its number here (use syntax tdf#NNNNNN to have it automatically linkified). Thanks!