]> git.koha-community.org Git - koha.git/commit
Bug 37510: Make Koha::Object->delete throw Koha::Exception
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 29 Jul 2024 12:16:56 +0000 (09:16 -0300)
committerKatrin Fischer <katrin.fischer@bsz-bw.de>
Fri, 16 Aug 2024 15:33:46 +0000 (17:33 +0200)
commit923dc5e078593f653b075813885bde34531c503e
treeda14b825e4049588f7cc239b0e3194408466564c
parent30a5baa70623625d2856450293b00ce34a764cd8
Bug 37510: Make Koha::Object->delete throw Koha::Exception

This patch makes Koha::Object->delete wrap DBIC exceptions on FK
constraints and throw a Koha::Exception::Object::FKConstraint exception
instead. This will allow us better handling it from the callers.

To test:
1. Apply the unit tests patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Koha/Object.t
=> FAIL: A DBIC exception is thrown instead, tests fail
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Koha/Exceptions/Object.pm
Koha/Object.pm