View | Details | Raw Unified | Return to bug 17712
Collapse All | Expand All

(-)a/Koha/Exceptions.pm (-1 / +26 lines)
Lines 9-14 use Exception::Class ( Link Here
9
        description => 'Something went wrong!',
9
        description => 'Something went wrong!',
10
    },
10
    },
11
11
12
    'Koha::Exceptions::BadParameter' => {
13
        isa => 'Koha::Exceptions::Exception',
14
        description => 'A bad parameter was given',
15
        fields => ['parameter'],
16
    },
12
    'Koha::Exceptions::DuplicateObject' => {
17
    'Koha::Exceptions::DuplicateObject' => {
13
        isa => 'Koha::Exceptions::Exception',
18
        isa => 'Koha::Exceptions::Exception',
14
        description => 'Same object already exists',
19
        description => 'Same object already exists',
Lines 17-25 use Exception::Class ( Link Here
17
        isa => 'Koha::Exceptions::Exception',
22
        isa => 'Koha::Exceptions::Exception',
18
        description => 'The default value cannot be deleted'
23
        description => 'The default value cannot be deleted'
19
    },
24
    },
25
    'Koha::Exceptions::InvalidDate' => {
26
        isa => 'Koha::Exceptions::Exception',
27
        description => "Date is invalid.",
28
        fields => ["date"],
29
    },
20
    'Koha::Exceptions::MissingParameter' => {
30
    'Koha::Exceptions::MissingParameter' => {
21
        isa => 'Koha::Exceptions::Exception',
31
        isa => 'Koha::Exceptions::Exception',
22
        description => 'A required parameter is missing'
32
        description => 'A required parameter is missing',
33
        fields => ["parameter"],
34
    },
35
    'Koha::Exceptions::AuthenticationRequired' => {
36
        isa => 'Koha::Exceptions::Exception',
37
        description => 'Auhtentication is required.',
38
    },
39
    'Koha::Exceptions::NoPermission' => {
40
        isa => 'Koha::Exceptions::Exception',
41
        description => 'No permission to access this resource.',
42
        fields => ["required_permissions"]
43
    },
44
    'Koha::Exceptions::NotImplemented' => {
45
        isa => 'Koha::Exceptions::Exception',
46
        description => 'A subroutine is not implemented',
47
        fields => ["subroutine"]
23
    },
48
    },
24
    # Virtualshelves exceptions
49
    # Virtualshelves exceptions
25
    'Koha::Exceptions::Virtualshelves::DuplicateObject' => {
50
    'Koha::Exceptions::Virtualshelves::DuplicateObject' => {
(-)a/Koha/Exceptions/Biblio.pm (+32 lines)
Line 0 Link Here
1
package Koha::Exceptions::Biblio;
2
3
use Modern::Perl;
4
5
use Exception::Class (
6
7
    'Koha::Exceptions::Biblio' => {
8
        description => 'Something went wrong!',
9
    },
10
    'Koha::Exceptions::Biblio::AnotherItemCheckedOut' => {
11
        isa => 'Koha::Exceptions::Biblio',
12
        description => "Another item from same biblio already checked out.",
13
        fields => ["itemnumbers"],
14
    },
15
    'Koha::Exceptions::Biblio::CheckedOut' => {
16
        isa => 'Koha::Exceptions::Biblio',
17
        description => "Biblio is already checked out for patron.",
18
        fields => ['biblionumber'],
19
    },
20
    'Koha::Exceptions::Biblio::NoAvailableItems' => {
21
        isa => 'Koha::Exceptions::Biblio',
22
        description => "Biblio does not have any available items.",
23
    },
24
    'Koha::Exceptions::Biblio::NotFound' => {
25
        isa => 'Koha::Exceptions::Biblio',
26
        description => "Biblio not found.",
27
        fields => ['biblionumber'],
28
    },
29
30
);
31
32
1;
(-)a/Koha/Exceptions/Checkout.pm (+66 lines)
Line 0 Link Here
1
package Koha::Exceptions::Checkout;
2
3
use Modern::Perl;
4
5
use Exception::Class (
6
7
    'Koha::Exceptions::Checkout' => {
8
        description => 'Something went wrong!',
9
    },
10
    'Koha::Exceptions::Checkout::DueDateBeforeNow' => {
11
        isa => 'Koha::Exceptions::Checkout',
12
        description => 'Given due date is already in the past.',
13
        fields => ["duedate", "now"],
14
    },
15
    'Koha::Exceptions::Checkout::Fee' => {
16
        isa => 'Koha::Exceptions::Checkout',
17
        description => "There are checkout fees.",
18
        fields => ["amount"],
19
    },
20
    'Koha::Exceptions::Checkout::InvalidDueDate' => {
21
        isa => 'Koha::Exceptions::Checkout',
22
        description => 'Given due date is invalid.',
23
        fields => ["duedate"],
24
    },
25
    'Koha::Exceptions::Checkout::MaximumCheckoutsReached' => {
26
        isa => 'Koha::Exceptions::Checkout',
27
        description => "Maximum number of checkouts have been reached, or none allowed.",
28
        fields => ["max_checkouts_allowed", "current_checkout_count"],
29
    },
30
    'Koha::Exceptions::Checkout::MaximumOnsiteCheckoutsReached' => {
31
        isa => 'Koha::Exceptions::Checkout',
32
        description => "Maximum number of on-site checkouts have been reached.",
33
        fields => ["max_onsite_checkouts", "current_onsite_checkouts"],
34
    },
35
    'Koha::Exceptions::Checkout::NoMoreRenewals' => {
36
        isa => 'Koha::Exceptions::Checkout',
37
        description => "No more renewals are allowed.",
38
    },
39
    'Koha::Exceptions::Checkout::NoRenewalForOnsiteCheckouts' => {
40
        isa => 'Koha::Exceptions::Checkout',
41
        description => "On-site checkouts cannot be renewed.",
42
    },
43
    'Koha::Exceptions::Checkout::OnsiteCheckoutsDisabled' => {
44
        isa => 'Koha::Exceptions::Checkout',
45
        description => "On-site checkouts are disabled.",
46
    },
47
    'Koha::Exceptions::Checkout::OnsiteCheckoutWillBeSwitched' => {
48
        isa => 'Koha::Exceptions::Checkout',
49
        description => "On-site checkout will be switched to normal checkout.",
50
    },
51
    'Koha::Exceptions::Checkout::PreviouslyCheckedOut' => {
52
        isa => 'Koha::Exceptions::Checkout',
53
        description => "This biblio has been previously checked out by this patron.",
54
    },
55
    'Koha::Exceptions::Checkout::Renew' => {
56
        isa => 'Koha::Exceptions::Checkout',
57
        description => "Checkout will be renewed.",
58
    },
59
    'Koha::Exceptions::Checkout::ZeroCheckoutsAllowed' => {
60
        isa => 'Koha::Exceptions::Checkout',
61
        description => "Matching issuing rule that does not allow any checkouts.",
62
    },
63
64
);
65
66
1;
(-)a/Koha/Exceptions/Hold.pm (+47 lines)
Line 0 Link Here
1
package Koha::Exceptions::Hold;
2
3
use Modern::Perl;
4
5
use Exception::Class (
6
7
    'Koha::Exceptions::Hold' => {
8
        description => 'Something went wrong!',
9
    },
10
    'Koha::Exceptions::Hold::ItemLevelHoldNotAllowed' => {
11
        isa => 'Koha::Exceptions::Hold',
12
        description => "Item level hold is not allowed.",
13
    },
14
    'Koha::Exceptions::Hold::MaximumHoldsReached' => {
15
        isa => 'Koha::Exceptions::Hold',
16
        description => "Maximum number of holds have been reached.",
17
        fields => ["max_holds_allowed", "current_hold_count"],
18
    },
19
    'Koha::Exceptions::Hold::MaximumHoldsForRecordReached' => {
20
        isa => 'Koha::Exceptions::Hold',
21
        description => "Maximum number of holds for a record have been reached.",
22
        fields => ["max_holds_allowed", "current_hold_count"],
23
    },
24
    'Koha::Exceptions::Hold::NotAllowedByLibrary' => {
25
        isa => 'Koha::Exceptions::Hold',
26
        description => "This library does not allow holds.",
27
    },
28
    'Koha::Exceptions::Hold::NotAllowedFromOtherLibraries' => {
29
        isa => 'Koha::Exceptions::Hold',
30
        description => "Cannot hold from other libraries.",
31
    },
32
    'Koha::Exceptions::Hold::NotAllowedInOPAC' => {
33
        isa => 'Koha::Exceptions::Hold',
34
        description => "Holds are disabled in OPAC.",
35
    },
36
    'Koha::Exceptions::Hold::OnShelfNotAllowed' => {
37
        isa => 'Koha::Exceptions::Hold',
38
        description => "On-shelf holds are not allowed.",
39
    },
40
    'Koha::Exceptions::Hold::ZeroHoldsAllowed' => {
41
        isa => 'Koha::Exceptions::Hold',
42
        description => "Matching hold rule that does not allow any holds.",
43
    },
44
45
);
46
47
1;
(-)a/Koha/Exceptions/Item.pm (+84 lines)
Line 0 Link Here
1
package Koha::Exceptions::Item;
2
3
use Modern::Perl;
4
5
use Exception::Class (
6
7
    'Koha::Exceptions::Item' => {
8
        description => 'Something went wrong!',
9
    },
10
    'Koha::Exceptions::Item::AlreadyHeldForThisPatron' => {
11
        isa => 'Koha::Exceptions::Item',
12
        description => "Item already held for this patron.",
13
    },
14
    'Koha::Exceptions::Item::CannotBeTransferred' => {
15
        isa => 'Koha::Exceptions::Item',
16
        description => "Item cannot be transferred from holding library to given library.",
17
        fields => ["from_library", "to_library"],
18
    },
19
    'Koha::Exceptions::Item::CheckedOut' => {
20
        isa => 'Koha::Exceptions::Item',
21
        description => "Item has already been checked out.",
22
        fields => ["borrowernumber", "date_due"],
23
    },
24
    'Koha::Exceptions::Item::Damaged' => {
25
        isa => 'Koha::Exceptions::Item',
26
        description => "Item is marked as damaged.",
27
    },
28
    'Koha::Exceptions::Item::FromAnotherLibrary' => {
29
        isa => 'Koha::Exceptions::Item',
30
        description => "Libraries are independent and item is not from this library.",
31
        fields => ["current_library", "from_library"],
32
    },
33
    'Koha::Exceptions::Item::Held' => {
34
        isa => 'Koha::Exceptions::Item',
35
        description => "Item held.",
36
        fields => ["borrowernumber", "hold_queue_length", "status"],
37
    },
38
    'Koha::Exceptions::Item::HighHolds' => {
39
        isa => 'Koha::Exceptions::Item',
40
        description => "High demand item. Loan period shortened.",
41
        fields => ["num_holds", "duration", "returndate"],
42
    },
43
    'Koha::Exceptions::Item::Lost' => {
44
        isa => 'Koha::Exceptions::Item',
45
        description => "Item is marked as lost.",
46
        fields => ["code", "status"],
47
    },
48
    'Koha::Exceptions::Item::NotForLoan' => {
49
        isa => 'Koha::Exceptions::Item',
50
        description => "Item is marked as not for loan.",
51
        fields => ["code", "status"],
52
    },
53
    'Koha::Exceptions::Item::NotFound' => {
54
        isa => 'Koha::Exceptions::Item',
55
        description => "Item not found.",
56
        fields => ['itemnumber'],
57
    },
58
    'Koha::Exceptions::Item::NotForLoanForcing' => {
59
        isa => 'Koha::Exceptions::Item',
60
        description => "Item is marked as not for loan, but it is possible to override.",
61
        fields => ["notforloan"],
62
    },
63
    'Koha::Exceptions::Item::Restricted' => {
64
        isa => 'Koha::Exceptions::Item',
65
        description => "Item is marked as restricted.",
66
    },
67
    'Koha::Exceptions::Item::Transfer' => {
68
        isa => 'Koha::Exceptions::Item',
69
        description => "Item is being transferred.",
70
        fields => ["datesent", "from_library", "to_library"],
71
    },
72
    'Koha::Exceptions::Item::UnknownBarcode' => {
73
        isa => 'Koha::Exceptions::Item',
74
        description => "Item has unknown barcode, or no barcode at all.",
75
        fields => ["barcode"],
76
    },
77
    'Koha::Exceptions::Item::Withdrawn' => {
78
        isa => 'Koha::Exceptions::Item',
79
        description => "Item is marked as withdrawn.",
80
    }
81
82
);
83
84
1;
(-)a/Koha/Exceptions/ItemType.pm (+18 lines)
Line 0 Link Here
1
package Koha::Exceptions::ItemType;
2
3
use Modern::Perl;
4
5
use Exception::Class (
6
7
    'Koha::Exceptions::ItemType' => {
8
        description => 'Something went wrong!',
9
    },
10
    'Koha::Exceptions::ItemType::NotForLoan' => {
11
        isa => 'Koha::Exceptions::ItemType',
12
        description => "This type of items are not for loan.",
13
        fields => ["itemtype", "status", "code"],
14
    },
15
16
);
17
18
1;
(-)a/Koha/Exceptions/Patron.pm (-1 / +66 lines)
Line 0 Link Here
0
- 
1
package Koha::Exceptions::Patron;
2
3
use Modern::Perl;
4
5
use Exception::Class (
6
7
    'Koha::Exceptions::Patron' => {
8
        description => 'Something went wrong!',
9
    },
10
    'Koha::Exceptions::Patron::AgeRestricted' => {
11
        isa => 'Koha::Exceptions::Patron',
12
        description => "Age restriction applies for patron.",
13
        fields => ["age_restriction"],
14
    },
15
    'Koha::Exceptions::Patron::CardExpired' => {
16
        isa => 'Koha::Exceptions::Patron',
17
        description => "Patron's card has expired.",
18
        fields => ["expiration_date"],
19
    },
20
    'Koha::Exceptions::Patron::CardLost' => {
21
        isa => 'Koha::Exceptions::Patron',
22
        description => "Patron's card has been marked as lost.",
23
    },
24
    'Koha::Exceptions::Patron::Debarred' => {
25
        isa => 'Koha::Exceptions::Patron',
26
        description => "Patron is debarred.",
27
        fields => ["expiration", "comment"],
28
    },
29
    'Koha::Exceptions::Patron::DebarredOverdue' => {
30
        isa => 'Koha::Exceptions::Patron',
31
        description => "Patron is debarred because of overdue checkouts.",
32
        fields => ["number_of_overdues"],
33
    },
34
    'Koha::Exceptions::Patron::Debt' => {
35
        isa => 'Koha::Exceptions::Patron',
36
        description => "Patron has debts.",
37
        fields => ["max_outstanding", "current_outstanding"],
38
    },
39
    'Koha::Exceptions::Patron::DebtGuarantees' => {
40
        isa => 'Koha::Exceptions::Patron',
41
        description => "Patron's guarantees have debts.",
42
        fields => ["max_outstanding", "current_outstanding", "guarantees"],
43
    },
44
    'Koha::Exceptions::Patron::FromAnotherLibrary' => {
45
        isa => 'Koha::Exceptions::Patron',
46
        description => "Libraries are independent and this patron is from another library than we are now logged in.",
47
        fields => ["patron_branch", "current_branch"],
48
    },
49
    'Koha::Exceptions::Patron::GoneNoAddress' => {
50
        isa => 'Koha::Exceptions::Patron',
51
        description => "Patron gone no address.",
52
    },
53
    'Koha::Exceptions::Patron::NotFound' => {
54
        isa => 'Koha::Exceptions::Patron',
55
        description => "Patron not found.",
56
        fields => ['borrowernumber'],
57
    },
58
    'Koha::Exceptions::Patron::OtherCharges' => {
59
        isa => 'Koha::Exceptions::Patron',
60
        description => "Patron has other outstanding charges.",
61
        fields => ["balance", "other_charges"],
62
    },
63
64
);
65
66
1;

Return to bug 17712