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