Bug 30477: Add new UNIMARC installer translation files
[koha.git] / Koha / Exceptions.pm
1 package Koha::Exceptions;
2
3 use Modern::Perl;
4
5 use Koha::Exception;
6
7 use Exception::Class (
8
9     'Koha::Exceptions::BadParameter' => {
10         isa => 'Koha::Exception',
11         description => 'A bad parameter was given',
12         fields => ['parameter'],
13     },
14     'Koha::Exceptions::DuplicateObject' => {
15         isa => 'Koha::Exception',
16         description => 'Same object already exists',
17     },
18     'Koha::Exceptions::ObjectNotFound' => {
19         isa => 'Koha::Exception',
20         description => 'The required object doesn\'t exist',
21     },
22     'Koha::Exceptions::ObjectNotCreated' => {
23         isa => 'Koha::Exception',
24         description => 'The object have not been created',
25     },
26     'Koha::Exceptions::CannotDeleteDefault' => {
27         isa => 'Koha::Exception',
28         description => 'The default value cannot be deleted'
29     },
30     'Koha::Exceptions::MissingParameter' => {
31         isa => 'Koha::Exception',
32         description => 'A required parameter is missing'
33     },
34     'Koha::Exceptions::ParameterTooHigh' => {
35         isa => 'Koha::Exception',
36         description => 'A passed parameter value is too high'
37     },
38     'Koha::Exceptions::NoChanges' => {
39         isa => 'Koha::Exception',
40         description => 'No changes were made',
41     },
42     'Koha::Exceptions::WrongParameter' => {
43         isa => 'Koha::Exception',
44         description => 'One or more parameters are wrong',
45     },
46     'Koha::Exceptions::NoPermission' => {
47         isa => 'Koha::Exception',
48         description => 'You do not have permission for this action',
49     },
50     'Koha::Exceptions::CannotAddLibraryLimit' => {
51         isa => 'Koha::Exception',
52         description => 'General problem adding a library limit'
53     },
54     'Koha::Exceptions::UnderMaintenance' => {
55         isa => 'Koha::Exception',
56         description => 'Koha is under maintenance.'
57     },
58     # Virtualshelves exceptions
59     'Koha::Exceptions::Virtualshelves::DuplicateObject' => {
60         isa => 'Koha::Exceptions::DuplicateObject',
61         description => "Duplicate shelf object",
62     },
63     'Koha::Exceptions::Virtualshelves::InvalidInviteKey' => {
64         isa => 'Koha::Exception',
65         description => 'Invalid key on accepting the share',
66     },
67     'Koha::Exceptions::Virtualshelves::InvalidKeyOnSharing' => {
68         isa => 'Koha::Exception',
69         description=> 'Invalid key on sharing a shelf',
70     },
71     'Koha::Exceptions::Virtualshelves::ShareHasExpired' => {
72         isa => 'Koha::Exception',
73         description=> 'Cannot share this shelf, the share has expired',
74     },
75     'Koha::Exceptions::Virtualshelves::UseDbAdminAccount' => {
76         isa => 'Koha::Exception',
77         description => "Invalid use of database administrator account",
78     }
79 );
80
81 1;