Currently, Koha::Object->store only handles FK and duplicate key problems. It should handle wrong format errors.
Created attachment 83534 [details] [review] Bug 22051: Add Koha::Exceptions::Object::WrongValue This patch adds a new exception to be thrown in Koha::Object->store when a DBIC exception is thrown regarding bad data format. To test: - Apply this patch - Run: $ kshell k$ prove t/Koha/Exceptions.t => SUCCESS: Tests pass! - Sign off :-D
Created attachment 83535 [details] [review] Bug 22051: Unit tests
Created attachment 83536 [details] [review] 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
Created attachment 83622 [details] [review] Bug 22051: Add Koha::Exceptions::Object::WrongValue This patch adds a new exception to be thrown in Koha::Object->store when a DBIC exception is thrown regarding bad data format. To test: - Apply this patch - Run: $ kshell k$ prove t/Koha/Exceptions.t => SUCCESS: Tests pass! - Sign off :-D Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 83623 [details] [review] Bug 22051: Unit tests Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 83624 [details] [review] 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>
Created attachment 83657 [details] [review] Bug 22051: Add Koha::Exceptions::Object::WrongValue This patch adds a new exception to be thrown in Koha::Object->store when a DBIC exception is thrown regarding bad data format. To test: - Apply this patch - Run: $ kshell k$ prove t/Koha/Exceptions.t => SUCCESS: Tests pass! - Sign off :-D Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>
Created attachment 83658 [details] [review] Bug 22051: Unit tests Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>
Created attachment 83659 [details] [review] 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>
Created attachment 83723 [details] [review] Bug 22051: Add Koha::Exceptions::Object::WrongValue This patch adds a new exception to be thrown in Koha::Object->store when a DBIC exception is thrown regarding bad data format. To test: - Apply this patch - Run: $ kshell k$ prove t/Koha/Exceptions.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>
Created attachment 83724 [details] [review] Bug 22051: Unit tests 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>
Created attachment 83725 [details] [review] 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>
Awesome work all! Pushed to master for 19.05
Developer aid, backporting to 18.11.x for 18.11.03
enhancement not backporting to 18.05.x