Bug 22051: Make Koha::Object->store translate incorrect value exceptions
authorTomas Cohen Arazi <tomascohen@theke.io>
Fri, 28 Dec 2018 15:15:53 +0000 (12:15 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 31 Jan 2019 17:14:00 +0000 (17:14 +0000)
commit2b8ba2e55874d2837c98a213afca0f4458767b05
tree0e8ce0c7b29ebf080b5ff534afc375ebadac7c51
parent18d934799f5d03d7ecbc694351e85776a4a248c8
Bug 22051: Make Koha::Object->store translate incorrect value exceptions

This patch adds a new condition to Koha::Object->store so it catches
incorrect value-related DBIC exceptions.

This DBIC exceptions get now translated into
Koha::Exceptions::Object::BadValue exceptions with relevant parameters
passed.

To test:
- Apply the exception and unit tests patches
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/Object.t
=> FAIL: Tests fail because this exception handling code is not
implemented
- Apply this patch
- Run:
 k$ prove t/db_dependent/Koha/Object.t
=> SUCCESS: Tests pass!
- Sign off :-D

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 659253eef12bb213058a8aed835ba6789aa3d9f0)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Koha/Object.pm