Bug 33176: Handle RequirePaymentType
[koha.git] / Koha / Exceptions / BackgroundJob.pm
1 package Koha::Exceptions::BackgroundJob;
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::BackgroundJob' => {
25         isa => 'Koha::Exception',
26     },
27     'Koha::Exceptions::BackgroundJob::InconsistentStatus' => {
28         isa         => 'Koha::Exceptions::BackgroundJob',
29         description => 'Status change requested but an invalid status found',
30         fields      => ['current_status', 'expected_status']
31     },
32     'Koha::Exceptions::BackgroundJob::StepOutOfBounds' => {
33         isa         => 'Koha::Exceptions::BackgroundJob',
34         description => 'Cannot move progress forward'
35     },
36 );
37
38 =head1 NAME
39
40 Koha::Exceptions::BackgroundJob - Base class for BackgroundJob exceptions
41
42 =head1 Exceptions
43
44 =head2 Koha::Exceptions::BackgroundJob
45
46 Generic BackgroundJob exception
47
48 =head2 Koha::Exceptions::BackgroundJob::InconsistentStatus
49
50 Exception to be used when an action on an BackgroundJob requires the job to
51 be in an specific I<status>, but it is not the case.
52
53 =head2 Koha::Exceptions::BackgroundJob::StepOutOfBounds
54
55 Exception to be used when the it is tried to advance one step in progress, but
56 the job size limit as been reached already.
57
58 =cut
59
60 1;