https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44048 --- Comment #1 from babar junaid <babarjunaid1122@gmail.com> --- Created attachment 211193 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211193&action=edit Bug 44048: Do not let add_debit swallow unexpected errors Bug 44048: Do not let add_debit swallow unexpected errors The catch block of Koha::Account->add_debit only handled FKConstraint exceptions. Any other error raised while storing the debit, its offset or its log was swallowed and add_debit returned undef, so the caller carried on as if the charge had been added and its transaction committed without it. Rethrow every error that is not the debit_type_code FK, as add_credit does. Test plan: 1. prove t/db_dependent/Koha/Account.t The new add_debit subtest (Koha::Account::Line->store mocked to die) fails without the patch: no exception, undef returned. 2. With the patch the whole file passes. Sponsored-by: Koha Solutions -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.