Bug 19828: Make Koha::Object->store translate DBIC exceptions into Koha exceptions
[koha.git] / Koha / Exceptions / Object.pm
1 package Koha::Exceptions::Object;
2
3 use Modern::Perl;
4
5 use Exception::Class (
6
7     'Koha::Exceptions::Object' => {
8         description => 'Something went wrong!',
9     },
10     'Koha::Exceptions::Object::DuplicateID' => {
11         isa         => 'Koha::Exceptions::Object',
12         description => "Duplicate ID passed",
13         fields      =>  ['duplicate_id']
14     },
15     'Koha::Exceptions::Object::FKConstraint' => {
16         isa         => 'Koha::Exceptions::Object',
17         description => "Foreign key constraint broken",
18         fields      =>  ['broken_fk']
19     },
20     'Koha::Exceptions::Object::MethodNotFound' => {
21         isa => 'Koha::Exceptions::Object',
22         description => "Invalid method",
23     },
24     'Koha::Exceptions::Object::PropertyNotFound' => {
25         isa => 'Koha::Exceptions::Object',
26         description => "Invalid property",
27     },
28     'Koha::Exceptions::Object::MethodNotCoveredByTests' => {
29         isa => 'Koha::Exceptions::Object',
30         description => "Method not covered by tests",
31     },
32 );
33
34 1;