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)
(earliest affected) release
Hardware: All Linux (All)
: low enhancement
Assignee: Not Assigned
Depends on:
Blocks: PDF-Export Exit
  Show dependency treegraph
Reported: 2013-02-09 14:27 UTC by nil0x42
Modified: 2021-11-08 16:52 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


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:


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