https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44315 --- Comment #4 from David Nind <david@davidnind.com> --- Created attachment 212751 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212751&action=edit Bug 44315: Make Koha::Sitemapper die on errors instead of exiting Koha::Sitemapper (invalid 'dir') and Koha::Sitemapper::Writer (sitemap file cannot be created) printed a message to STDOUT and called exit, which ends the process with status 0. sitemap.pl then reported success although no sitemap was written, so callers like koha-sitemap could not notice the failure. This patch makes them die instead, with the reason on STDERR (including the system error when a file cannot be created), so sitemap.pl exits with a non-zero status. Test plan: 1. Apply the regression tests patch and run: $ ktd --shell k$ prove t/db_dependent/Sitemapper.t => FAIL: The test file stops early 2. Apply this patch and repeat 1 => SUCCESS: Tests pass! 3. Run sitemap.pl with an invalid directory: k$ perl misc/cronjobs/sitemap.pl --dir /nonexistent ; echo "exit=$?" => SUCCESS: "This is not a valid directory: /nonexistent" and a non-zero exit status (it was 0 before this patch) 4. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.