6842b2806e25463abcbbff8593cd02ffdae1f26f
[koha.git] / Koha / Exceptions / Item / Transfer.pm
1 package Koha::Exceptions::Item::Transfer;
2
3 # This file is part of Koha.
4 #
5 # Koha is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # Koha is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with Koha; if not, see <http://www.gnu.org/licenses>.
17
18 use Modern::Perl;
19
20 use Koha::Exception;
21
22 use Exception::Class (
23
24     'Koha::Exceptions::Item::Transfer' => {
25         isa => 'Koha::Exception',
26     },
27     'Koha::Exceptions::Item::Transfer::InQueue' => {
28         isa         => 'Koha::Exceptions::Item::Transfer',
29         description => "Active item transfer already exists",
30         fields      => ['transfer']
31     },
32     'Koha::Exceptions::Item::Transfer::Limit' => {
33         isa         => 'Koha::Exceptions::Item::Transfer',
34         description => "Transfer not allowed"
35     },
36     'Koha::Exceptions::Item::Transfer::OnLoan' => {
37         isa         => 'Koha::Exceptions::Item::Transfer',
38         description => "Transfer item is currently checked out"
39     },
40     'Koha::Exceptions::Item::Transfer::InTransit' => {
41         isa         => 'Koha::Exceptions::Item::Transfer',
42         description => "Transfer item is currently in transit"
43     }
44 );
45
46 =head1 NAME
47
48 Koha::Exceptions::Item::Transfer - Base class for Transfer exceptions
49
50 =head1 Exceptions
51
52 =head2 Koha::Exceptions::Item::Transfer
53
54 Generic Item::Transfer exception
55
56 =head2 Koha::Exceptions::Item::Transfer::InQueue
57
58 Exception to be used when an active item transfer prevents a transfer action.
59
60 =head2 Koha::Exceptions::Item::Transfer::Limit
61
62 Exception to be used when transfer limits prevent a transfer action.
63
64 =head2 Koha::Exceptions::Item::Transfer::OnLoan
65
66 Exception to be used when an active checkout prevents a transfer action.
67
68 =head2 Koha::Exceptions::Item::Transfer::InTransit
69
70 Exception to be used when an in transit transfer prevents a transfer action.
71
72 =cut
73
74 1;