Headless LibreOffice fails with zero status code?

asked 2020-02-15 03:00:35 +0100

lffg gravatar image

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?

edit retag flag offensive close merge delete

Comments

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...

Mike Kaganski gravatar imageMike Kaganski ( 2020-02-15 08:02:18 +0100 )edit

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. :)

lffg gravatar imagelffg ( 2020-02-15 20:44:11 +0100 )edit

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

Mike Kaganski gravatar imageMike Kaganski ( 2020-02-16 06:45:05 +0100 )edit