Bug 26057: Add 'cancel' method to Koha::Item::Transfer
[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 Exception::Class (
21
22     'Koha::Exceptions::Item::Transfer' => {
23         description => 'Something went wrong'
24     },
25     'Koha::Exceptions::Item::Transfer::Found' => {
26         isa         => 'Koha::Exceptions::Item::Transfer',
27         description => "Active item transfer already exists",
28         fields      => ['transfer']
29     },
30     'Koha::Exceptions::Item::Transfer::Limit' => {
31         isa         => 'Koha::Exceptions::Item::Transfer',
32         description => "Transfer not allowed"
33     },
34     'Koha::Exceptions::Item::Transfer::Out' => {
35         isa         => 'Koha::Exceptions::Item::Transfer',
36         description => "Transfer item is currently checked out"
37     },
38     'Koha::Exceptions::Item::Transfer::Transit' => {
39         isa         => 'Koha::Exceptions::Item::Transfer',
40         description => "Transfer item is currently in transit"
41     }
42 );
43
44 =head1 NAME
45
46 Koha::Exceptions::Item::Transfer - Base class for Transfer exceptions
47
48 =head1 Exceptions
49
50 =head2 Koha::Exceptions::Item::Transfer
51
52 Generic Item::Transfer exception
53
54 =head2 Koha::Exceptions::Item::Transfer::Found
55
56 Exception to be used when an active item transfer prevents a transfer action.
57
58 =head2 Koha::Exceptions::Item::Transfer::Limit
59
60 Exception to be used when transfer limits prevent a transfer action.
61
62 =head2 Koha::Exceptions::Item::Transfer::Out
63
64 Exception to be used when an active checkout prevents a transfer action.
65
66 =head2 Koha::Exceptions::Item::Transfer::Transit
67
68 Exception to be used when an in transit transfer prevents a transfer action.
69
70 =cut
71
72 1;