Bug 60544

Summary: Implement exit codes for improved error checking in scripts invoking LO in headless mode
Product: LibreOffice Reporter: nil0x42 <nil0x42>
Component: LibreOfficeAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: enhancement CC: buzea.bogdan
Priority: low    
Version: 3.6.5.2 release   
Hardware: All   
OS: Linux (All)   
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 103378, 145593    

Description nil0x42 2013-02-09 14:27:22 UTC
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
Comment 1 Owen Genat (retired) 2013-12-14 11:27:56 UTC
As I indicated in this comment:

https://bugs.freedesktop.org/show_bug.cgi?id=52125#c8

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

http://nabble.documentfoundation.org/Are-return-codes-implemented-td4018980.html

Therefore confirmed (seems worthwhile for scripting). Status set to NEW. Summary edited for greater clarity.
Comment 2 Owen Genat (retired) 2014-01-06 10:28:00 UTC
Setting version back from "Inherited From OOo" to what it was prior (for bugs marked enhancement), for QA tracking purposes. My mistake. Apologies.
Comment 3 Rai 2014-01-21 21:58:32 UTC
+1
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
- ...
- ...