From c1542671c1a021f2643ea89be708db2f70237cb5 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 4 Jul 2025 13:17:25 +0300 Subject: return nonzero exit code when fatal error is triggered in on a CLI SAPI --- include/errorhandler.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/errorhandler.php') diff --git a/include/errorhandler.php b/include/errorhandler.php index 2b6d51a7d..027cf2a6f 100644 --- a/include/errorhandler.php +++ b/include/errorhandler.php @@ -84,6 +84,9 @@ function ttrss_fatal_handler(): bool { return Logger::log_error((int)$errno, $errstr, $file, (int)$line, $context); } + if (php_sapi_name() == 'cli') + exit(1); + return false; } -- cgit v1.2.3-54-g00ecf From b0dc82dc7e50e39f589cc0e417385532bebb9821 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 4 Jul 2025 13:22:06 +0300 Subject: only exit with nonzero exit code if there was an error --- include/errorhandler.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include/errorhandler.php') diff --git a/include/errorhandler.php b/include/errorhandler.php index 027cf2a6f..a20ee05b0 100644 --- a/include/errorhandler.php +++ b/include/errorhandler.php @@ -81,11 +81,11 @@ function ttrss_fatal_handler(): bool { } if (class_exists("Logger")) - return Logger::log_error((int)$errno, $errstr, $file, (int)$line, $context); - } + Logger::log_error((int)$errno, $errstr, $file, (int)$line, $context); - if (php_sapi_name() == 'cli') - exit(1); + if (php_sapi_name() == 'cli') + exit(1); + } return false; } -- cgit v1.2.3-54-g00ecf