https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40445
--- Comment #113 from Martin Renvoize (ashimema) <[email protected]> --- Created attachment 193126 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=193126&action=edit Bug 40445: Improve error handling and validation Enhances cashup error handling and prevents invalid operations. Changes: - Centralized exception handling in Cash Register methods - Detailed error messages for specific exception types: * MissingParameter: Shows parameter name * AmountNotPositive: Clarifies positive amount requirement * Unhandled: Displays debug information - Validation prevents starting cashup with zero transactions - Proper Koha::Exceptions thrown instead of raw DBIx::Class errors Test plan: 1. Apply patch and run prove t/db_dependent/Koha/Cash/Register.t 2. Attempt to start cashup with no transactions: - Verify informational error: "Cannot start cashup - no cash transactions" 3. Attempt cashup operations triggering various exceptions: - Missing parameter: Verify parameter name shown - Zero/negative amount: Verify clear validation message 4. Add cash transaction and retry: - Verify cashup starts successfully 5. Test multi-register operations: - Verify appropriate errors for registers with no transactions - Verify other registers process successfully Sponsored-by: OpenFifth <https://openfifth.co.uk/> Signed-off-by: Jackie Usher <[email protected]> -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
