Bug 60544 - Implement exit codes for improved error checking in scripts invoking LO in headless mode
Summary: Implement exit codes for improved error checking in scripts invoking LO in he...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
3.6.5.2 release
Hardware: All Linux (All)
: low enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-09 14:27 UTC by nil0x42
Modified: 2014-01-21 21:58 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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
- ...
- ...