Bug 33708: Make staff interface login not require public API (OAuth/OIDC)
[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::FileNotFound' => {
19         isa => 'Koha::Exception',
20         description => 'File not found',
21         fields      => ['filename'],
22     },
23     'Koha::Exceptions::InvalidStatus' => {
24         isa         => 'Koha::Exception',
25         description => 'The current status is not valid in context',
26         fields      => ['invalid_status'],
27     },
28     'Koha::Exceptions::ObjectNotFound' => {
29         isa => 'Koha::Exception',
30         description => 'The required object doesn\'t exist',
31     },
32     'Koha::Exceptions::PayloadTooLarge' => {
33         isa => 'Koha::Exception',
34         description => 'Request entity is larger than limits defined by server',
35     },
36     'Koha::Exceptions::ObjectNotCreated' => {
37         isa => 'Koha::Exception',
38         description => 'The object have not been created',
39     },
40     'Koha::Exceptions::CannotDeleteDefault' => {
41         isa => 'Koha::Exception',
42         description => 'The default value cannot be deleted'
43     },
44     'Koha::Exceptions::CannotDeleteSystem' => {
45         isa => 'Koha::Exception',
46         description => 'The system value cannot be deleted'
47     },
48     'Koha::Exceptions::MissingParameter' => {
49         isa => 'Koha::Exception',
50         description => 'A required parameter is missing',
51         fields => ['parameter'],
52     },
53     'Koha::Exceptions::ParameterTooHigh' => {
54         isa => 'Koha::Exception',
55         description => 'A passed parameter value is too high'
56     },
57     'Koha::Exceptions::NoChanges' => {
58         isa => 'Koha::Exception',
59         description => 'No changes were made',
60     },
61     'Koha::Exceptions::WrongParameter' => {
62         isa => 'Koha::Exception',
63         description => 'Parameter has wrong value or type',
64         fields => ['name', 'value', 'type'],
65     },
66     'Koha::Exceptions::NoPermission' => {
67         isa => 'Koha::Exception',
68         description => 'You do not have permission for this action',
69     },
70     'Koha::Exceptions::CannotAddLibraryLimit' => {
71         isa => 'Koha::Exception',
72         description => 'General problem adding a library limit'
73     },
74     'Koha::Exceptions::UnderMaintenance' => {
75         isa => 'Koha::Exception',
76         description => 'Koha is under maintenance.'
77     },
78 );
79
80 1;