Bug 28489: Modify sessions.a_session from longtext to longblob
[koha.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::ObjectNotCreated' => {
22         isa => 'Koha::Exceptions::Exception',
23         description => 'The object have not been created',
24     },
25     'Koha::Exceptions::CannotDeleteDefault' => {
26         isa => 'Koha::Exceptions::Exception',
27         description => 'The default value cannot be deleted'
28     },
29     'Koha::Exceptions::MissingParameter' => {
30         isa => 'Koha::Exceptions::Exception',
31         description => 'A required parameter is missing'
32     },
33     'Koha::Exceptions::ParameterTooHigh' => {
34         isa => 'Koha::Exceptions::Exception',
35         description => 'A passed parameter value is too high'
36     },
37     'Koha::Exceptions::NoChanges' => {
38         isa => 'Koha::Exceptions::Exception',
39         description => 'No changes were made',
40     },
41     'Koha::Exceptions::WrongParameter' => {
42         isa => 'Koha::Exceptions::Exception',
43         description => 'One or more parameters are wrong',
44     },
45     'Koha::Exceptions::NoPermission' => {
46         isa => 'Koha::Exceptions::Exception',
47         description => 'You do not have permission for this action',
48     },
49     'Koha::Exceptions::CannotAddLibraryLimit' => {
50         isa => 'Koha::Exceptions::Exception',
51         description => 'General problem adding a library limit'
52     },
53     'Koha::Exceptions::UnderMaintenance' => {
54         isa => 'Koha::Exceptions::Exception',
55         description => 'Koha is under maintenance.'
56     },
57     # Virtualshelves exceptions
58     'Koha::Exceptions::Virtualshelves::DuplicateObject' => {
59         isa => 'Koha::Exceptions::DuplicateObject',
60         description => "Duplicate shelf object",
61     },
62     'Koha::Exceptions::Virtualshelves::InvalidInviteKey' => {
63         isa => 'Koha::Exceptions::Exception',
64         description => 'Invalid key on accepting the share',
65     },
66     'Koha::Exceptions::Virtualshelves::InvalidKeyOnSharing' => {
67         isa => 'Koha::Exceptions::Exception',
68         description=> 'Invalid key on sharing a shelf',
69     },
70     'Koha::Exceptions::Virtualshelves::ShareHasExpired' => {
71         isa => 'Koha::Exceptions::Exception',
72         description=> 'Cannot share this shelf, the share has expired',
73     },
74     'Koha::Exceptions::Virtualshelves::UseDbAdminAccount' => {
75         isa => 'Koha::Exceptions::Exception',
76         description => "Invalid use of database administrator account",
77     }
78 );
79
80 1;