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