Bug 155415 - Exit status is zero even with fatal command-line errors
Summary: Exit status is zero even with fatal command-line errors
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: framework (show other bugs)
Version:
(earliest affected)
7.6.0.0 alpha1+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-19 22:14 UTC by Jim Avera
Modified: 2023-08-10 10:18 UTC (History)
1 user (show)

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 Jim Avera 2023-05-19 22:14:13 UTC
Description:
When using libreoffice as a non-interactive command line tool, the exit status seems to always be zero even if fatal errors occurred.   This causes unsuspecting scripts to continue their merry way without realizing that something went horribly wrong.

The Linux/Unix rule is that a ZERO exit status means "success" and non-zero means otherwise. 

Steps to Reproduce:
1. libreoffice --convert-to "bogus" /dev/null
>Error: source file could not be loaded
2. echo $? 

Actual Results:
0 exit status

Expected Results:
non-zero exit status


Reproducible: Always


User Profile Reset: No

Additional Info:
For reference, here is a complete command to extract sheets from a spreadsheet into .csv files in the current directory.  You can substitute valid and invalid input file names
to test "working" and "failing" cases:

libreoffice --convert-to "csv:Text - txt - csv (StarCalc):44,34,76,1,,,true,,true,false,-1" FILE.xlsx
Comment 1 Buovjaga 2023-08-10 10:18:05 UTC
Repro

Arch Linux 64-bit, X11
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 2d0268f5ae6061bc96c00481c9ef3547be300b5a
CPU threads: 8; OS: Linux 6.4; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 10 August 2023