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