Bug 25411: Regression tests
[koha.git] / Koha / Exceptions.pm
blobcf56b220efc109abbbedd2777c7fe877b0428fdc
1 package Koha::Exceptions;
3 use Modern::Perl;
4 use Koha::Exceptions::Exception;
6 use Exception::Class (
8 'Koha::Exceptions::BadParameter' => {
9 isa => 'Koha::Exceptions::Exception',
10 description => 'A bad parameter was given',
11 fields => ['parameter'],
13 'Koha::Exceptions::DuplicateObject' => {
14 isa => 'Koha::Exceptions::Exception',
15 description => 'Same object already exists',
17 'Koha::Exceptions::ObjectNotFound' => {
18 isa => 'Koha::Exceptions::Exception',
19 description => 'The required object doesn\'t exist',
21 'Koha::Exceptions::CannotDeleteDefault' => {
22 isa => 'Koha::Exceptions::Exception',
23 description => 'The default value cannot be deleted'
25 'Koha::Exceptions::MissingParameter' => {
26 isa => 'Koha::Exceptions::Exception',
27 description => 'A required parameter is missing'
29 'Koha::Exceptions::ParameterTooHigh' => {
30 isa => 'Koha::Exceptions::Exception',
31 description => 'A passed parameter value is too high'
33 'Koha::Exceptions::NoChanges' => {
34 isa => 'Koha::Exceptions::Exception',
35 description => 'No changes were made',
37 'Koha::Exceptions::WrongParameter' => {
38 isa => 'Koha::Exceptions::Exception',
39 description => 'One or more parameters are wrong',
41 'Koha::Exceptions::NoPermission' => {
42 isa => 'Koha::Exceptions::Exception',
43 description => 'You do not have permission for this action',
45 'Koha::Exceptions::CannotAddLibraryLimit' => {
46 isa => 'Koha::Exceptions::Exception',
47 description => 'General problem adding a library limit'
49 'Koha::Exceptions::UnderMaintenance' => {
50 isa => 'Koha::Exceptions::Exception',
51 description => 'Koha is under maintenance.'
53 # Virtualshelves exceptions
54 'Koha::Exceptions::Virtualshelves::DuplicateObject' => {
55 isa => 'Koha::Exceptions::DuplicateObject',
56 description => "Duplicate shelf object",
58 'Koha::Exceptions::Virtualshelves::InvalidInviteKey' => {
59 isa => 'Koha::Exceptions::Exception',
60 description => 'Invalid key on accepting the share',
62 'Koha::Exceptions::Virtualshelves::InvalidKeyOnSharing' => {
63 isa => 'Koha::Exceptions::Exception',
64 description=> 'Invalid key on sharing a shelf',
66 'Koha::Exceptions::Virtualshelves::ShareHasExpired' => {
67 isa => 'Koha::Exceptions::Exception',
68 description=> 'Cannot share this shelf, the share has expired',
70 'Koha::Exceptions::Virtualshelves::UseDbAdminAccount' => {
71 isa => 'Koha::Exceptions::Exception',
72 description => "Invalid use of database administrator account",