1 package Koha::Exceptions::BackgroundJob;
3 # This file is part of Koha.
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.
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.
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>.
22 use Exception::Class (
24 'Koha::Exceptions::BackgroundJob' => {
25 isa => 'Koha::Exception',
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']
32 'Koha::Exceptions::BackgroundJob::StepOutOfBounds' => {
33 isa => 'Koha::Exceptions::BackgroundJob',
34 description => 'Cannot move progress forward'
40 Koha::Exceptions::BackgroundJob - Base class for BackgroundJob exceptions
44 =head2 Koha::Exceptions::BackgroundJob
46 Generic BackgroundJob exception
48 =head2 Koha::Exceptions::BackgroundJob::InconsistentStatus
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.
53 =head2 Koha::Exceptions::BackgroundJob::StepOutOfBounds
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.