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