https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44315 Bug ID: 44315 Summary: Koha::Sitemapper exits with status 0 on errors Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Command-line Utilities Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org CC: jake.deery@openfifth.co.uk, robin@catalyst.net.nz Target Milestone: --- When Koha::Sitemapper cannot do its job it prints a message to STDOUT and calls exit, which ends the whole process with status 0: * Koha::Sitemapper: the "dir" attribute trigger, when the directory is not valid ("This is not a valid directory: ...") * Koha::Sitemapper::Writer::_writer_create, when a sitemap file cannot be created ("Impossible to create file: ...") As a result misc/cronjobs/sitemap.pl reports success although no sitemap was written, so cron jobs and wrappers (e.g. koha-sitemap) cannot detect the failure. A library module should not call exit at all. To reproduce: perl misc/cronjobs/sitemap.pl --dir /nonexistent ; echo $? => "This is not a valid directory: /nonexistent" on STDOUT, exit status 0 Expected: die with the reason on STDERR (including the system error when a file cannot be created), so sitemap.pl exits with a non-zero status. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.