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

(-)a/Koha/Acquisition/Orders.pm (-1 / +1 lines)
Lines 22-28 use Koha::Database; Link Here
22
22
23
use Koha::DateUtils qw( dt_from_string );
23
use Koha::DateUtils qw( dt_from_string );
24
use Koha::Acquisition::Order;
24
use Koha::Acquisition::Order;
25
use Koha::Exceptions::Exception;
25
use Koha::Exception;
26
26
27
use base qw(Koha::Objects);
27
use base qw(Koha::Objects);
28
28
(-)a/Koha/BackgroundJob.pm (-3 / +3 lines)
Lines 126-134 sub enqueue { Link Here
126
                # Picking a random id (memcached_namespace) from the config
126
                # Picking a random id (memcached_namespace) from the config
127
                my $namespace = C4::Context->config('memcached_namespace');
127
                my $namespace = C4::Context->config('memcached_namespace');
128
                $conn->send_with_receipt( { destination => sprintf("/queue/%s-%s", $namespace, $job_type), body => $json_args } )
128
                $conn->send_with_receipt( { destination => sprintf("/queue/%s-%s", $namespace, $job_type), body => $json_args } )
129
                  or Koha::Exceptions::Exception->throw('Job has not been enqueued');
129
                  or Koha::Exception->throw('Job has not been enqueued');
130
            } catch {
130
            } catch {
131
                if ( ref($_) eq 'Koha::Exceptions::Exception' ) {
131
                if ( ref($_) eq 'Koha::Exception' ) {
132
                    $_->rethrow;
132
                    $_->rethrow;
133
                } else {
133
                } else {
134
                    warn sprintf "The job has not been sent to the message broker: (%s)", $_;
134
                    warn sprintf "The job has not been sent to the message broker: (%s)", $_;
Lines 236-242 sub _derived_class { Link Here
236
236
237
    my $class = $self->type_to_class_mapping->{$job_type};
237
    my $class = $self->type_to_class_mapping->{$job_type};
238
238
239
    Koha::Exceptions::Exception->throw($job_type . ' is not a valid job_type')
239
    Koha::Exception->throw($job_type . ' is not a valid job_type')
240
        unless $class;
240
        unless $class;
241
241
242
    eval "require $class";
242
    eval "require $class";
(-)a/Koha/Checkout.pm (-2 / +2 lines)
Lines 199-210 sub claim_returned { Link Here
199
        );
199
        );
200
    }
200
    }
201
    catch {
201
    catch {
202
        if ( $_->isa('Koha::Exceptions::Exception') ) {
202
        if ( $_->isa('Koha::Exception') ) {
203
            $_->rethrow();
203
            $_->rethrow();
204
        }
204
        }
205
        else {
205
        else {
206
            # ?
206
            # ?
207
            Koha::Exceptions::Exception->throw( "Unhandled exception" );
207
            Koha::Exception->throw( "Unhandled exception" );
208
        }
208
        }
209
    };
209
    };
210
}
210
}
(-)a/Koha/Exceptions/Exception.pm (-3 / +2 lines)
Lines 1-10 Link Here
1
package Koha::Exceptions::Exception;
1
package Koha::Exception;
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
4
5
# Looks like this class should be more Koha::Exception::Base;
6
use Exception::Class (
5
use Exception::Class (
7
    'Koha::Exceptions::Exception' => {
6
    'Koha::Exception' => {
8
        description => "Something went wrong!"
7
        description => "Something went wrong!"
9
    },
8
    },
10
);
9
);
(-)a/Koha/Exceptions.pm (-17 / +18 lines)
Lines 1-57 Link Here
1
package Koha::Exceptions;
1
package Koha::Exceptions;
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
use Koha::Exceptions::Exception;
4
5
use Koha::Exception;
5
6
6
use Exception::Class (
7
use Exception::Class (
7
8
8
    'Koha::Exceptions::BadParameter' => {
9
    'Koha::Exceptions::BadParameter' => {
9
        isa => 'Koha::Exceptions::Exception',
10
        isa => 'Koha::Exception',
10
        description => 'A bad parameter was given',
11
        description => 'A bad parameter was given',
11
        fields => ['parameter'],
12
        fields => ['parameter'],
12
    },
13
    },
13
    'Koha::Exceptions::DuplicateObject' => {
14
    'Koha::Exceptions::DuplicateObject' => {
14
        isa => 'Koha::Exceptions::Exception',
15
        isa => 'Koha::Exception',
15
        description => 'Same object already exists',
16
        description => 'Same object already exists',
16
    },
17
    },
17
    'Koha::Exceptions::ObjectNotFound' => {
18
    'Koha::Exceptions::ObjectNotFound' => {
18
        isa => 'Koha::Exceptions::Exception',
19
        isa => 'Koha::Exception',
19
        description => 'The required object doesn\'t exist',
20
        description => 'The required object doesn\'t exist',
20
    },
21
    },
21
    'Koha::Exceptions::ObjectNotCreated' => {
22
    'Koha::Exceptions::ObjectNotCreated' => {
22
        isa => 'Koha::Exceptions::Exception',
23
        isa => 'Koha::Exception',
23
        description => 'The object have not been created',
24
        description => 'The object have not been created',
24
    },
25
    },
25
    'Koha::Exceptions::CannotDeleteDefault' => {
26
    'Koha::Exceptions::CannotDeleteDefault' => {
26
        isa => 'Koha::Exceptions::Exception',
27
        isa => 'Koha::Exception',
27
        description => 'The default value cannot be deleted'
28
        description => 'The default value cannot be deleted'
28
    },
29
    },
29
    'Koha::Exceptions::MissingParameter' => {
30
    'Koha::Exceptions::MissingParameter' => {
30
        isa => 'Koha::Exceptions::Exception',
31
        isa => 'Koha::Exception',
31
        description => 'A required parameter is missing'
32
        description => 'A required parameter is missing'
32
    },
33
    },
33
    'Koha::Exceptions::ParameterTooHigh' => {
34
    'Koha::Exceptions::ParameterTooHigh' => {
34
        isa => 'Koha::Exceptions::Exception',
35
        isa => 'Koha::Exception',
35
        description => 'A passed parameter value is too high'
36
        description => 'A passed parameter value is too high'
36
    },
37
    },
37
    'Koha::Exceptions::NoChanges' => {
38
    'Koha::Exceptions::NoChanges' => {
38
        isa => 'Koha::Exceptions::Exception',
39
        isa => 'Koha::Exception',
39
        description => 'No changes were made',
40
        description => 'No changes were made',
40
    },
41
    },
41
    'Koha::Exceptions::WrongParameter' => {
42
    'Koha::Exceptions::WrongParameter' => {
42
        isa => 'Koha::Exceptions::Exception',
43
        isa => 'Koha::Exception',
43
        description => 'One or more parameters are wrong',
44
        description => 'One or more parameters are wrong',
44
    },
45
    },
45
    'Koha::Exceptions::NoPermission' => {
46
    'Koha::Exceptions::NoPermission' => {
46
        isa => 'Koha::Exceptions::Exception',
47
        isa => 'Koha::Exception',
47
        description => 'You do not have permission for this action',
48
        description => 'You do not have permission for this action',
48
    },
49
    },
49
    'Koha::Exceptions::CannotAddLibraryLimit' => {
50
    'Koha::Exceptions::CannotAddLibraryLimit' => {
50
        isa => 'Koha::Exceptions::Exception',
51
        isa => 'Koha::Exception',
51
        description => 'General problem adding a library limit'
52
        description => 'General problem adding a library limit'
52
    },
53
    },
53
    'Koha::Exceptions::UnderMaintenance' => {
54
    'Koha::Exceptions::UnderMaintenance' => {
54
        isa => 'Koha::Exceptions::Exception',
55
        isa => 'Koha::Exception',
55
        description => 'Koha is under maintenance.'
56
        description => 'Koha is under maintenance.'
56
    },
57
    },
57
    # Virtualshelves exceptions
58
    # Virtualshelves exceptions
Lines 60-78 use Exception::Class ( Link Here
60
        description => "Duplicate shelf object",
61
        description => "Duplicate shelf object",
61
    },
62
    },
62
    'Koha::Exceptions::Virtualshelves::InvalidInviteKey' => {
63
    'Koha::Exceptions::Virtualshelves::InvalidInviteKey' => {
63
        isa => 'Koha::Exceptions::Exception',
64
        isa => 'Koha::Exception',
64
        description => 'Invalid key on accepting the share',
65
        description => 'Invalid key on accepting the share',
65
    },
66
    },
66
    'Koha::Exceptions::Virtualshelves::InvalidKeyOnSharing' => {
67
    'Koha::Exceptions::Virtualshelves::InvalidKeyOnSharing' => {
67
        isa => 'Koha::Exceptions::Exception',
68
        isa => 'Koha::Exception',
68
        description=> 'Invalid key on sharing a shelf',
69
        description=> 'Invalid key on sharing a shelf',
69
    },
70
    },
70
    'Koha::Exceptions::Virtualshelves::ShareHasExpired' => {
71
    'Koha::Exceptions::Virtualshelves::ShareHasExpired' => {
71
        isa => 'Koha::Exceptions::Exception',
72
        isa => 'Koha::Exception',
72
        description=> 'Cannot share this shelf, the share has expired',
73
        description=> 'Cannot share this shelf, the share has expired',
73
    },
74
    },
74
    'Koha::Exceptions::Virtualshelves::UseDbAdminAccount' => {
75
    'Koha::Exceptions::Virtualshelves::UseDbAdminAccount' => {
75
        isa => 'Koha::Exceptions::Exception',
76
        isa => 'Koha::Exception',
76
        description => "Invalid use of database administrator account",
77
        description => "Invalid use of database administrator account",
77
    }
78
    }
78
);
79
);
(-)a/Koha/Exceptions/Account.pm (-2 / +2 lines)
Lines 17-28 package Koha::Exceptions::Account; Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Koha::Exceptions::Exception;
20
use Koha::Exception;
21
21
22
use Exception::Class (
22
use Exception::Class (
23
23
24
    'Koha::Exceptions::Account' => {
24
    'Koha::Exceptions::Account' => {
25
        isa => 'Koha::Exceptions::Exception',
25
        isa => 'Koha::Exception',
26
    },
26
    },
27
    'Koha::Exceptions::Account::IsNotCredit' => {
27
    'Koha::Exceptions::Account::IsNotCredit' => {
28
        isa         => 'Koha::Exceptions::Account',
28
        isa         => 'Koha::Exceptions::Account',
(-)a/Koha/Exceptions/Acquisition/Basket.pm (-2 / +2 lines)
Lines 17-28 package Koha::Exceptions::Acquisition::Basket; Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Koha::Exceptions::Exception;
20
use Koha::Exception;
21
21
22
use Exception::Class (
22
use Exception::Class (
23
23
24
    'Koha::Exceptions::Acquisition::Basket' => {
24
    'Koha::Exceptions::Acquisition::Basket' => {
25
        isa => 'Koha::Exceptions::Exception',
25
        isa => 'Koha::Exception',
26
    },
26
    },
27
    'Koha::Exceptions::Acquisition::Basket::AlreadyClosed' => {
27
    'Koha::Exceptions::Acquisition::Basket::AlreadyClosed' => {
28
        isa         => 'Koha::Exceptions::Acquisition::Basket',
28
        isa         => 'Koha::Exceptions::Acquisition::Basket',
(-)a/Koha/Exceptions/ArticleRequest.pm (-2 / +2 lines)
Lines 17-27 package Koha::Exceptions::ArticleRequest; Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Koha::Exceptions::Exception;
20
use Koha::Exception;
21
21
22
use Exception::Class (
22
use Exception::Class (
23
    'Koha::Exceptions::ArticleRequest' => {
23
    'Koha::Exceptions::ArticleRequest' => {
24
        isa => 'Koha::Exceptions::Exception',
24
        isa => 'Koha::Exception',
25
    },
25
    },
26
    'Koha::Exceptions::ArticleRequest::LimitReached' => {
26
    'Koha::Exceptions::ArticleRequest::LimitReached' => {
27
        isa         => 'Koha::Exceptions::ArticleRequest',
27
        isa         => 'Koha::Exceptions::ArticleRequest',
(-)a/Koha/Exceptions/Authentication.pm (-2 / +2 lines)
Lines 2-13 package Koha::Exceptions::Authentication; Link Here
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
4
5
use Koha::Exceptions::Exception;
5
use Koha::Exception;
6
6
7
use Exception::Class (
7
use Exception::Class (
8
8
9
    'Koha::Exceptions::Authentication' => {
9
    'Koha::Exceptions::Authentication' => {
10
        isa => 'Koha::Exceptions::Exception',
10
        isa => 'Koha::Exception',
11
    },
11
    },
12
    'Koha::Exceptions::Authentication::Required' => {
12
    'Koha::Exceptions::Authentication::Required' => {
13
        isa => 'Koha::Exceptions::Authentication',
13
        isa => 'Koha::Exceptions::Authentication',
(-)a/Koha/Exceptions/Authorization.pm (-2 / +2 lines)
Lines 2-13 package Koha::Exceptions::Authorization; Link Here
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
4
5
use Koha::Exceptions::Exception;
5
use Koha::Exception;
6
6
7
use Exception::Class (
7
use Exception::Class (
8
8
9
    'Koha::Exceptions::Authorization' => {
9
    'Koha::Exceptions::Authorization' => {
10
        isa => 'Koha::Exceptions::Exception',
10
        isa => 'Koha::Exception',
11
    },
11
    },
12
    'Koha::Exceptions::Authorization::Unauthorized' => {
12
    'Koha::Exceptions::Authorization::Unauthorized' => {
13
        isa => 'Koha::Exceptions::Authorization',
13
        isa => 'Koha::Exceptions::Authorization',
(-)a/Koha/Exceptions/Checkout.pm (-2 / +2 lines)
Lines 2-12 package Koha::Exceptions::Checkout; Link Here
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
4
5
use Koha::Exceptions::Exception;
5
use Koha::Exception;
6
6
7
use Exception::Class (
7
use Exception::Class (
8
    'Koha::Exceptions::Checkout' => {
8
    'Koha::Exceptions::Checkout' => {
9
        isa => 'Koha::Exceptions::Exception',
9
        isa => 'Koha::Exception',
10
    },
10
    },
11
    'Koha::Exceptions::Checkout::FailedRenewal' => {
11
    'Koha::Exceptions::Checkout::FailedRenewal' => {
12
        isa         => 'Koha::Exceptions::Checkout',
12
        isa         => 'Koha::Exceptions::Checkout',
(-)a/Koha/Exceptions/Checkouts/ReturnClaims.pm (-2 / +2 lines)
Lines 17-27 package Koha::Exceptions::Checkouts::ReturnClaims; Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Koha::Exceptions::Exception;
20
use Koha::Exception;
21
21
22
use Exception::Class (
22
use Exception::Class (
23
    'Koha::Exceptions::Checkouts::ReturnClaims' => {
23
    'Koha::Exceptions::Checkouts::ReturnClaims' => {
24
        isa         => 'Koha::Exceptions::Exception',
24
        isa         => 'Koha::Exception',
25
    },
25
    },
26
    'Koha::Exceptions::Checkouts::ReturnClaims::NoCreatedBy' => {
26
    'Koha::Exceptions::Checkouts::ReturnClaims::NoCreatedBy' => {
27
        isa         => 'Koha::Exceptions::Checkouts::ReturnClaims',
27
        isa         => 'Koha::Exceptions::Checkouts::ReturnClaims',
(-)a/Koha/Exceptions/ClubHold.pm (-2 / +2 lines)
Lines 2-12 package Koha::Exceptions::ClubHold; Link Here
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
4
5
use Koha::Exceptions::Exception;
5
use Koha::Exception;
6
6
7
use Exception::Class (
7
use Exception::Class (
8
    'Koha::Exceptions::ClubHold' => {
8
    'Koha::Exceptions::ClubHold' => {
9
        isa => 'Koha::Exceptions::Exception',
9
        isa => 'Koha::Exception',
10
    },
10
    },
11
    'Koha::Exceptions::ClubHold::NoPatrons' => {
11
    'Koha::Exceptions::ClubHold::NoPatrons' => {
12
        isa => 'Koha::Exceptions::ClubHold',
12
        isa => 'Koha::Exceptions::ClubHold',
(-)a/Koha/Exceptions/Config.pm (-2 / +2 lines)
Lines 2-13 package Koha::Exceptions::Config; Link Here
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
4
5
use Koha::Exceptions::Exception;
5
use Koha::Exception;
6
6
7
use Exception::Class (
7
use Exception::Class (
8
8
9
    'Koha::Exceptions::Config' => {
9
    'Koha::Exceptions::Config' => {
10
        isa => 'Koha::Exceptions::Exception',
10
        isa => 'Koha::Exception',
11
    },
11
    },
12
    'Koha::Exceptions::Config::MissingEntry' => {
12
    'Koha::Exceptions::Config::MissingEntry' => {
13
        isa => 'Koha::Exceptions::Config',
13
        isa => 'Koha::Exceptions::Config',
(-)a/Koha/Exceptions/Elasticsearch.pm (-2 / +2 lines)
Lines 17-28 package Koha::Exceptions::Elasticsearch; Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Koha::Exceptions::Exception;
20
use Koha::Exception;
21
21
22
use Exception::Class (
22
use Exception::Class (
23
23
24
    'Koha::Exceptions::Elasticsearch' => {
24
    'Koha::Exceptions::Elasticsearch' => {
25
        isa => 'Koha::Exceptions::Exception',
25
        isa => 'Koha::Exception',
26
    },
26
    },
27
    'Koha::Exceptions::Elasticsearch::BadResponse' => {
27
    'Koha::Exceptions::Elasticsearch::BadResponse' => {
28
        isa         => 'Koha::Exceptions::Elasticsearch',
28
        isa         => 'Koha::Exceptions::Elasticsearch',
(-)a/Koha/Exceptions/Hold.pm (-2 / +2 lines)
Lines 17-27 package Koha::Exceptions::Hold; Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Koha::Exceptions::Exception;
20
use Koha::Exception;
21
21
22
use Exception::Class (
22
use Exception::Class (
23
    'Koha::Exceptions::Hold' => {
23
    'Koha::Exceptions::Hold' => {
24
        isa => 'Koha::Exceptions::Exception',
24
        isa => 'Koha::Exception',
25
    },
25
    },
26
    'Koha::Exceptions::Hold::CannotSuspendFound' => {
26
    'Koha::Exceptions::Hold::CannotSuspendFound' => {
27
        isa         => 'Koha::Exceptions::Hold',
27
        isa         => 'Koha::Exceptions::Hold',
(-)a/Koha/Exceptions/Ill.pm (-2 / +2 lines)
Lines 17-28 package Koha::Exceptions::Ill; Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Koha::Exceptions::Exception;
20
use Koha::Exception;
21
21
22
use Exception::Class (
22
use Exception::Class (
23
23
24
    'Koha::Exceptions::Ill' => {
24
    'Koha::Exceptions::Ill' => {
25
        isa => 'Koha::Exceptions::Exception',
25
        isa => 'Koha::Exception',
26
    },
26
    },
27
    'Koha::Exceptions::Ill::InvalidBackendId' => {
27
    'Koha::Exceptions::Ill::InvalidBackendId' => {
28
        isa => 'Koha::Exceptions::Ill',
28
        isa => 'Koha::Exceptions::Ill',
(-)a/Koha/Exceptions/Item/Transfer.pm (-2 / +2 lines)
Lines 17-28 package Koha::Exceptions::Item::Transfer; Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Koha::Exceptions::Exception;
20
use Koha::Exception;
21
21
22
use Exception::Class (
22
use Exception::Class (
23
23
24
    'Koha::Exceptions::Item::Transfer' => {
24
    'Koha::Exceptions::Item::Transfer' => {
25
        isa => 'Koha::Exceptions::Exception',
25
        isa => 'Koha::Exception',
26
    },
26
    },
27
    'Koha::Exceptions::Item::Transfer::InQueue' => {
27
    'Koha::Exceptions::Item::Transfer::InQueue' => {
28
        isa         => 'Koha::Exceptions::Item::Transfer',
28
        isa         => 'Koha::Exceptions::Item::Transfer',
(-)a/Koha/Exceptions/Library.pm (-2 / +2 lines)
Lines 2-13 package Koha::Exceptions::Library; Link Here
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
4
5
use Koha::Exceptions::Exception;
5
use Koha::Exception;
6
6
7
use Exception::Class (
7
use Exception::Class (
8
8
9
    'Koha::Exceptions::Library::Exception' => {
9
    'Koha::Exceptions::Library::Exception' => {
10
        isa => 'Koha::Exceptions::Exception',
10
        isa => 'Koha::Exception',
11
    },
11
    },
12
12
13
    'Koha::Exceptions::Library::NotFound' => {
13
    'Koha::Exceptions::Library::NotFound' => {
(-)a/Koha/Exceptions/MarcOverlayRule.pm (-2 / +2 lines)
Lines 17-28 package Koha::Exceptions::MarcOverlayRule; Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Koha::Exceptions::Exception;
20
use Koha::Exception;
21
21
22
use Exception::Class (
22
use Exception::Class (
23
23
24
    'Koha::Exceptions::MarcOverlayRule' => {
24
    'Koha::Exceptions::MarcOverlayRule' => {
25
        isa => 'Koha::Exceptions::Exception',
25
        isa => 'Koha::Exception',
26
    },
26
    },
27
    'Koha::Exceptions::MarcOverlayRule::InvalidTagRegExp' => {
27
    'Koha::Exceptions::MarcOverlayRule::InvalidTagRegExp' => {
28
        isa => 'Koha::Exceptions::MarcOverlayRule',
28
        isa => 'Koha::Exceptions::MarcOverlayRule',
(-)a/Koha/Exceptions/Metadata.pm (-2 / +2 lines)
Lines 17-28 package Koha::Exceptions::Metadata; Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Koha::Exceptions::Exception;
20
use Koha::Exception;
21
21
22
use Exception::Class (
22
use Exception::Class (
23
23
24
    'Koha::Exceptions::Metadata' => {
24
    'Koha::Exceptions::Metadata' => {
25
        isa => 'Koha::Exceptions::Exception',
25
        isa => 'Koha::Exception',
26
    },
26
    },
27
    'Koha::Exceptions::Metadata::Invalid' => {
27
    'Koha::Exceptions::Metadata::Invalid' => {
28
        isa => 'Koha::Exceptions::Metadata',
28
        isa => 'Koha::Exceptions::Metadata',
(-)a/Koha/Exceptions/Object.pm (-2 / +2 lines)
Lines 17-27 package Koha::Exceptions::Object; Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Koha::Exceptions::Exception;
20
use Koha::Exception;
21
21
22
use Exception::Class (
22
use Exception::Class (
23
    'Koha::Exceptions::Object' => {
23
    'Koha::Exceptions::Object' => {
24
        isa         => 'Koha::Exceptions::Exception',
24
        isa         => 'Koha::Exception',
25
    },
25
    },
26
    'Koha::Exceptions::Object::DuplicateID' => {
26
    'Koha::Exceptions::Object::DuplicateID' => {
27
        isa         => 'Koha::Exceptions::Object',
27
        isa         => 'Koha::Exceptions::Object',
(-)a/Koha/Exceptions/Password.pm (-2 / +2 lines)
Lines 17-28 package Koha::Exceptions::Password; Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Koha::Exceptions::Exception;
20
use Koha::Exception;
21
21
22
use Exception::Class (
22
use Exception::Class (
23
23
24
    'Koha::Exceptions::Password' => {
24
    'Koha::Exceptions::Password' => {
25
        isa => 'Koha::Exceptions::Exception',
25
        isa => 'Koha::Exception',
26
    },
26
    },
27
    'Koha::Exceptions::Password::Invalid' => {
27
    'Koha::Exceptions::Password::Invalid' => {
28
        isa => 'Koha::Exceptions::Password',
28
        isa => 'Koha::Exceptions::Password',
(-)a/Koha/Exceptions/Patron.pm (-2 / +2 lines)
Lines 2-12 package Koha::Exceptions::Patron; Link Here
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
4
5
use Koha::Exceptions::Exception;
5
use Koha::Exception;
6
6
7
use Exception::Class (
7
use Exception::Class (
8
    'Koha::Exceptions::Patron' => {
8
    'Koha::Exceptions::Patron' => {
9
        isa => 'Koha::Exceptions::Exception',
9
        isa => 'Koha::Exception',
10
    },
10
    },
11
    'Koha::Exceptions::Patron::FailedDelete' => {
11
    'Koha::Exceptions::Patron::FailedDelete' => {
12
        isa         => 'Koha::Exceptions::Patron',
12
        isa         => 'Koha::Exceptions::Patron',
(-)a/Koha/Exceptions/Patron/Attribute.pm (-2 / +2 lines)
Lines 2-13 package Koha::Exceptions::Patron::Attribute; Link Here
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
4
5
use Koha::Exceptions::Exception;
5
use Koha::Exception;
6
6
7
use Exception::Class (
7
use Exception::Class (
8
8
9
    'Koha::Exceptions::Patron::Attribute' => {
9
    'Koha::Exceptions::Patron::Attribute' => {
10
        isa => 'Koha::Exceptions::Exception',
10
        isa => 'Koha::Exception',
11
    },
11
    },
12
    'Koha::Exceptions::Patron::Attribute::InvalidType' => {
12
    'Koha::Exceptions::Patron::Attribute::InvalidType' => {
13
        isa         => 'Koha::Exceptions::Patron::Attribute',
13
        isa         => 'Koha::Exceptions::Patron::Attribute',
(-)a/Koha/Exceptions/Patron/Attribute/Type.pm (-2 / +2 lines)
Lines 2-13 package Koha::Exceptions::Patron::Attribute::Type; Link Here
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
4
5
use Koha::Exceptions::Exception;
5
use Koha::Exception;
6
6
7
use Exception::Class (
7
use Exception::Class (
8
8
9
    'Koha::Exceptions::Patron::Attribute::Type' => {
9
    'Koha::Exceptions::Patron::Attribute::Type' => {
10
        isa => 'Koha::Exceptions::Exception',
10
        isa => 'Koha::Exception',
11
    },
11
    },
12
    'Koha::Exceptions::Patron::Attribute::Type::CannotChangeProperty' => {
12
    'Koha::Exceptions::Patron::Attribute::Type::CannotChangeProperty' => {
13
        isa => 'Koha::Exceptions::Patron::Attribute::Type',
13
        isa => 'Koha::Exceptions::Patron::Attribute::Type',
(-)a/Koha/Exceptions/Patron/Modification.pm (-2 / +2 lines)
Lines 2-13 package Koha::Exceptions::Patron::Modification; Link Here
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
4
5
use Koha::Exceptions::Exception;
5
use Koha::Exception;
6
6
7
use Exception::Class (
7
use Exception::Class (
8
8
9
    'Koha::Exceptions::Patron::Modification' => {
9
    'Koha::Exceptions::Patron::Modification' => {
10
        isa => 'Koha::Exceptions::Exception',
10
        isa => 'Koha::Exception',
11
    },
11
    },
12
    'Koha::Exceptions::Patron::Modification::DuplicateVerificationToken' => {
12
    'Koha::Exceptions::Patron::Modification::DuplicateVerificationToken' => {
13
        isa => 'Koha::Exceptions::Patron::Modification',
13
        isa => 'Koha::Exceptions::Patron::Modification',
(-)a/Koha/Exceptions/Patron/Relationship.pm (-2 / +2 lines)
Lines 17-28 package Koha::Exceptions::Patron::Relationship; Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Koha::Exceptions::Exception;
20
use Koha::Exception;
21
21
22
use Exception::Class (
22
use Exception::Class (
23
23
24
    'Koha::Exceptions::Patron::Relationship' => {
24
    'Koha::Exceptions::Patron::Relationship' => {
25
        isa => 'Koha::Exceptions::Exception',
25
        isa => 'Koha::Exception',
26
    },
26
    },
27
    'Koha::Exceptions::Patron::Relationship::DuplicateRelationship' => {
27
    'Koha::Exceptions::Patron::Relationship::DuplicateRelationship' => {
28
        isa         => 'Koha::Exceptions::Patron::Relationship',
28
        isa         => 'Koha::Exceptions::Patron::Relationship',
(-)a/Koha/Exceptions/Plugin.pm (-2 / +2 lines)
Lines 17-27 package Koha::Exceptions::Plugin; Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Koha::Exceptions::Exception;
20
use Koha::Exception;
21
21
22
use Exception::Class (
22
use Exception::Class (
23
    'Koha::Exceptions::Plugin' => {
23
    'Koha::Exceptions::Plugin' => {
24
        isa         => 'Koha::Exceptions::Exception',
24
        isa         => 'Koha::Exception',
25
    },
25
    },
26
    'Koha::Exceptions::Plugin::ForbiddenAction' => {
26
    'Koha::Exceptions::Plugin::ForbiddenAction' => {
27
        isa         => 'Koha::Exceptions::Plugin',
27
        isa         => 'Koha::Exceptions::Plugin',
(-)a/Koha/Exceptions/Token.pm (-2 / +2 lines)
Lines 17-27 package Koha::Exceptions::Token; Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Koha::Exceptions::Exception;
20
use Koha::Exception;
21
21
22
use Exception::Class (
22
use Exception::Class (
23
    'Koha::Exceptions::Token' => {
23
    'Koha::Exceptions::Token' => {
24
        isa => 'Koha::Exceptions::Exception',
24
        isa => 'Koha::Exception',
25
    },
25
    },
26
    'Koha::Exceptions::Token::BadPattern' => {
26
    'Koha::Exceptions::Token::BadPattern' => {
27
        isa => 'Koha::Exceptions::Token',
27
        isa => 'Koha::Exceptions::Token',
(-)a/Koha/Exceptions/TransferLimit.pm (-2 / +2 lines)
Lines 17-28 package Koha::Exceptions::TransferLimit; Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Koha::Exceptions::Exception;
20
use Koha::Exception;
21
21
22
use Exception::Class (
22
use Exception::Class (
23
23
24
    'Koha::Exceptions::TransferLimit::Exception' => {
24
    'Koha::Exceptions::TransferLimit::Exception' => {
25
        isa => 'Koha::Exceptions::Exception',
25
        isa => 'Koha::Exception',
26
    },
26
    },
27
27
28
    'Koha::Exceptions::TransferLimit::Duplicate' => {
28
    'Koha::Exceptions::TransferLimit::Duplicate' => {
(-)a/Koha/Object.pm (-1 / +1 lines)
Lines 907-913 sub _handle_to_api_child { Link Here
907
907
908
    if ( defined $child ) {
908
    if ( defined $child ) {
909
909
910
        Koha::Exceptions::Exception->throw( "Asked to embed $curr but its return value doesn't implement to_api" )
910
        Koha::Exception->throw( "Asked to embed $curr but its return value doesn't implement to_api" )
911
            if defined $next and blessed $child and !$child->can('to_api');
911
            if defined $next and blessed $child and !$child->can('to_api');
912
912
913
        if ( blessed $child ) {
913
        if ( blessed $child ) {
(-)a/Koha/REST/V1/Patrons.pm (-2 / +2 lines)
Lines 338-344 sub delete { Link Here
338
            # Pick the first error, if any
338
            # Pick the first error, if any
339
            my ( $error ) = grep { $_->type eq 'error' } @{ $safe_to_delete->messages };
339
            my ( $error ) = grep { $_->type eq 'error' } @{ $safe_to_delete->messages };
340
            unless ( $error ) {
340
            unless ( $error ) {
341
                Koha::Exceptions::Exception->throw('Koha::Patron->safe_to_delete returned false but carried no error message');
341
                Koha::Exception->throw('Koha::Patron->safe_to_delete returned false but carried no error message');
342
            }
342
            }
343
343
344
            my $error_descriptions = {
344
            my $error_descriptions = {
Lines 357-363 sub delete { Link Here
357
                    }
357
                    }
358
                );
358
                );
359
            } else {
359
            } else {
360
                Koha::Exceptions::Exception->throw( 'Koha::Patron->safe_to_delete carried an unexpected message: ' . $error->message );
360
                Koha::Exception->throw( 'Koha::Patron->safe_to_delete carried an unexpected message: ' . $error->message );
361
            }
361
            }
362
        }
362
        }
363
363
(-)a/Koha/Script.pm (-3 / +3 lines)
Lines 40-46 use Fcntl qw( LOCK_EX LOCK_NB ); Link Here
40
40
41
use C4::Context;
41
use C4::Context;
42
use Koha::Exceptions;
42
use Koha::Exceptions;
43
use Koha::Exceptions::Exception;
43
use Koha::Exception;
44
44
45
sub import {
45
sub import {
46
    my $class = shift;
46
    my $class = shift;
Lines 136-145 sub lock_exec { Link Here
136
    my $lock_params = ($params->{wait}) ? LOCK_EX : LOCK_EX | LOCK_NB;
136
    my $lock_params = ($params->{wait}) ? LOCK_EX : LOCK_EX | LOCK_NB;
137
137
138
    open my $lock_handle, '>', $self->{lock_file}
138
    open my $lock_handle, '>', $self->{lock_file}
139
        or Koha::Exceptions::Exception->throw("Unable to open the lock file ".$self->{lock_file}.": $!");
139
        or Koha::Exception->throw("Unable to open the lock file ".$self->{lock_file}.": $!");
140
    $self->{lock_handle} = $lock_handle;
140
    $self->{lock_handle} = $lock_handle;
141
    flock( $lock_handle, $lock_params )
141
    flock( $lock_handle, $lock_params )
142
        or Koha::Exceptions::Exception->throw("Unable to acquire the lock ".$self->{lock_file}.": $!");
142
        or Koha::Exception->throw("Unable to acquire the lock ".$self->{lock_file}.": $!");
143
}
143
}
144
144
145
=head2 Internal methods
145
=head2 Internal methods
(-)a/Koha/SearchEngine/Elasticsearch/Indexer.pm (-2 / +2 lines)
Lines 226-232 sub index_status { Link Here
226
                INDEX_STATUS_RECREATE_REQUIRED,
226
                INDEX_STATUS_RECREATE_REQUIRED,
227
            )
227
            )
228
        ) {
228
        ) {
229
            Koha::Exceptions::Exception->throw("Invalid index status: $status");
229
            Koha::Exception->throw("Invalid index status: $status");
230
        }
230
        }
231
        C4::Context->set_preference($key, $status);
231
        C4::Context->set_preference($key, $status);
232
        return $status;
232
        return $status;
Lines 263-269 sub update_mappings { Link Here
263
            $self->set_index_status_recreate_required();
263
            $self->set_index_status_recreate_required();
264
            my $reason = $_[0]->{vars}->{body}->{error}->{reason};
264
            my $reason = $_[0]->{vars}->{body}->{error}->{reason};
265
            my $index_name = $self->index_name;
265
            my $index_name = $self->index_name;
266
            Koha::Exceptions::Exception->throw(
266
            Koha::Exception->throw(
267
                error => "Unable to update mappings for index \"$index_name\". Reason was: \"$reason\". Index needs to be recreated and reindexed",
267
                error => "Unable to update mappings for index \"$index_name\". Reason was: \"$reason\". Index needs to be recreated and reindexed",
268
            );
268
            );
269
        };
269
        };
(-)a/admin/smart-rules.pl (-3 / +3 lines)
Lines 22-28 use CGI qw ( -utf8 ); Link Here
22
use C4::Context;
22
use C4::Context;
23
use C4::Output qw( output_html_with_http_headers );
23
use C4::Output qw( output_html_with_http_headers );
24
use C4::Auth qw( get_template_and_user );
24
use C4::Auth qw( get_template_and_user );
25
use Koha::Exceptions::Exception;
25
use Koha::Exception;
26
use Koha::DateUtils qw( dt_from_string output_pref );
26
use Koha::DateUtils qw( dt_from_string output_pref );
27
use Koha::Database;
27
use Koha::Database;
28
use Koha::Logger;
28
use Koha::Logger;
Lines 462-468 elsif ( $op eq "add-open-article-requests-limit" ) { Link Here
462
    my $categorycode                = $input->param('categorycode');
462
    my $categorycode                = $input->param('categorycode');
463
    my $open_article_requests_limit = strip_non_numeric( scalar $input->param('open_article_requests_limit') );
463
    my $open_article_requests_limit = strip_non_numeric( scalar $input->param('open_article_requests_limit') );
464
464
465
    Koha::Exceptions::Exception->throw("No value passed for article request limit")
465
    Koha::Exception->throw("No value passed for article request limit")
466
      if not defined $open_article_requests_limit # There is a JS check for that
466
      if not defined $open_article_requests_limit # There is a JS check for that
467
      || $open_article_requests_limit eq '';
467
      || $open_article_requests_limit eq '';
468
468
Lines 536-542 elsif ( $op eq "set-article-request-fee" ) { Link Here
536
    my $category = $input->param('article_request_fee_category');
536
    my $category = $input->param('article_request_fee_category');
537
    my $fee      = strip_non_numeric( scalar $input->param('article_request_fee') );
537
    my $fee      = strip_non_numeric( scalar $input->param('article_request_fee') );
538
538
539
    Koha::Exceptions::Exception->throw("No value passed for article request fee")
539
    Koha::Exception->throw("No value passed for article request fee")
540
      if not defined $fee # There is a JS check for that
540
      if not defined $fee # There is a JS check for that
541
      || $fee eq '';
541
      || $fee eq '';
542
542
(-)a/t/db_dependent/Koha/BackgroundJobs/BatchUpdateBiblio.t (-2 / +2 lines)
Lines 26-32 use JSON qw( encode_json decode_json ); Link Here
26
use Koha::Database;
26
use Koha::Database;
27
use Koha::BackgroundJobs;
27
use Koha::BackgroundJobs;
28
use Koha::BackgroundJob::BatchUpdateBiblio;
28
use Koha::BackgroundJob::BatchUpdateBiblio;
29
use Koha::Exceptions::Exception;
29
use Koha::Exception;
30
use t::lib::TestBuilder;
30
use t::lib::TestBuilder;
31
31
32
my $schema = Koha::Database->new->schema;
32
my $schema = Koha::Database->new->schema;
Lines 40-46 subtest "Exceptions must be stringified" => sub { Link Here
40
40
41
    my $C4_biblio_module = Test::MockModule->new('C4::Biblio');
41
    my $C4_biblio_module = Test::MockModule->new('C4::Biblio');
42
    $C4_biblio_module->mock( 'ModBiblio',
42
    $C4_biblio_module->mock( 'ModBiblio',
43
        sub { Koha::Exceptions::Exception->throw("It didn't work"); } );
43
        sub { Koha::Exception->throw("It didn't work"); } );
44
44
45
    my $biblio = $builder->build_sample_biblio;
45
    my $biblio = $builder->build_sample_biblio;
46
    my $patron = $builder->build_object( { class => 'Koha::Patrons' } );
46
    my $patron = $builder->build_object( { class => 'Koha::Patrons' } );
(-)a/t/db_dependent/Koha/Biblio.t (-2 / +2 lines)
Lines 29-35 use Koha::Acquisition::Orders; Link Here
29
use Koha::AuthorisedValueCategories;
29
use Koha::AuthorisedValueCategories;
30
use Koha::AuthorisedValues;
30
use Koha::AuthorisedValues;
31
use Koha::MarcSubfieldStructures;
31
use Koha::MarcSubfieldStructures;
32
use Koha::Exceptions::Exception;
32
use Koha::Exception;
33
33
34
use MARC::Field;
34
use MARC::Field;
35
use MARC::Record;
35
use MARC::Record;
Lines 544-550 subtest 'get_marc_components() tests' => sub { Link Here
544
    $search_mod->unmock( 'simple_search_compat');
544
    $search_mod->unmock( 'simple_search_compat');
545
545
546
    $search_mod->mock( 'simple_search_compat',
546
    $search_mod->mock( 'simple_search_compat',
547
        sub { Koha::Exceptions::Exception->throw("error searching analytics") }
547
        sub { Koha::Exception->throw("error searching analytics") }
548
    );
548
    );
549
    warning_like { $components = $host_biblio->get_marc_components }
549
    warning_like { $components = $host_biblio->get_marc_components }
550
        qr{^Warning from simple_search_compat: 'error searching analytics'};
550
        qr{^Warning from simple_search_compat: 'error searching analytics'};
(-)a/t/db_dependent/Koha/Object.t (-1 / +1 lines)
Lines 329-335 subtest "to_api() tests" => sub { Link Here
329
        $new_biblio_api = $new_biblio->to_api(
329
        $new_biblio_api = $new_biblio->to_api(
330
            { embed => { 'items' => { children => { asd => {} } } } } );
330
            { embed => { 'items' => { children => { asd => {} } } } } );
331
    }
331
    }
332
    'Koha::Exceptions::Exception',
332
    'Koha::Exception',
333
"An exception is thrown if a blessed object to embed doesn't implement to_api";
333
"An exception is thrown if a blessed object to embed doesn't implement to_api";
334
334
335
    is(
335
    is(
(-)a/t/db_dependent/api/v1/unhandled_exceptions.t (-1 / +1 lines)
Lines 53-59 subtest 'unhandled_exception() tests' => sub { Link Here
53
    my $message = 'delete died';
53
    my $message = 'delete died';
54
54
55
    my $mock_patron = Test::MockModule->new('Koha::Patron');
55
    my $mock_patron = Test::MockModule->new('Koha::Patron');
56
    $mock_patron->mock( 'delete', sub { Koha::Exceptions::Exception->throw($message); } );
56
    $mock_patron->mock( 'delete', sub { Koha::Exception->throw($message); } );
57
57
58
    my $patron = $builder->build_object({ class => 'Koha::Patrons' });
58
    my $patron = $builder->build_object({ class => 'Koha::Patrons' });
59
59
(-)a/t/lib/plugins/Koha/Plugin/Test.pm (-12 / +12 lines)
Lines 3-9 package Koha::Plugin::Test; Link Here
3
## It's good practice to use Modern::Perl
3
## It's good practice to use Modern::Perl
4
use Modern::Perl;
4
use Modern::Perl;
5
5
6
use Koha::Exceptions::Exception;
6
use Koha::Exception;
7
use Koha::Plugins::Tab;
7
use Koha::Plugins::Tab;
8
8
9
use Mojo::JSON qw( decode_json );
9
use Mojo::JSON qw( decode_json );
Lines 99-111 sub item_barcode_transform { Link Here
99
    if ( Scalar::Util::looks_like_number( $$barcode ) ) {
99
    if ( Scalar::Util::looks_like_number( $$barcode ) ) {
100
        $$barcode = $$barcode * 2
100
        $$barcode = $$barcode * 2
101
    }
101
    }
102
    Koha::Exceptions::Exception->throw("item_barcode_transform called with parameter: $param");
102
    Koha::Exception->throw("item_barcode_transform called with parameter: $param");
103
}
103
}
104
104
105
sub patron_barcode_transform {
105
sub patron_barcode_transform {
106
    my ( $self, $barcode ) = @_;
106
    my ( $self, $barcode ) = @_;
107
    $$barcode //= '';
107
    $$barcode //= '';
108
    Koha::Exceptions::Exception->throw("patron_barcode_transform called with parameter: $$barcode");
108
    Koha::Exception->throw("patron_barcode_transform called with parameter: $$barcode");
109
}
109
}
110
110
111
sub configure {
111
sub configure {
Lines 144-150 sub api_namespace { Link Here
144
144
145
sub after_hold_create {
145
sub after_hold_create {
146
    my ( $self, $param ) = @_;
146
    my ( $self, $param ) = @_;
147
    Koha::Exceptions::Exception->throw("after_hold_create called with parameter " . ref($param) );
147
    Koha::Exception->throw("after_hold_create called with parameter " . ref($param) );
148
}
148
}
149
149
150
sub after_biblio_action {
150
sub after_biblio_action {
Lines 154-163 sub after_biblio_action { Link Here
154
    my $biblio_id = $params->{biblio_id};
154
    my $biblio_id = $params->{biblio_id};
155
155
156
    if ( $action ne 'delete' ) {
156
    if ( $action ne 'delete' ) {
157
        Koha::Exceptions::Exception->throw("after_biblio_action called with action: $action, ref: " . ref($biblio) );
157
        Koha::Exception->throw("after_biblio_action called with action: $action, ref: " . ref($biblio) );
158
    }
158
    }
159
    else {
159
    else {
160
        Koha::Exceptions::Exception->throw("after_biblio_action called with action: $action, id: $biblio_id") if $biblio_id;
160
        Koha::Exception->throw("after_biblio_action called with action: $action, id: $biblio_id") if $biblio_id;
161
    }
161
    }
162
}
162
}
163
163
Lines 170-181 sub after_item_action { Link Here
170
    if ( $action ne 'delete' ) {
170
    if ( $action ne 'delete' ) {
171
        my $itemnumber_defined = (defined $item->itemnumber) ? 'yes' : 'no';
171
        my $itemnumber_defined = (defined $item->itemnumber) ? 'yes' : 'no';
172
        my $item_id_defined    = (defined $item_id) ? 'yes' : 'no';
172
        my $item_id_defined    = (defined $item_id) ? 'yes' : 'no';
173
        Koha::Exceptions::Exception->throw("after_item_action called with action: $action, ref: " . ref($item) . " ".
173
        Koha::Exception->throw("after_item_action called with action: $action, ref: " . ref($item) . " ".
174
                                           "item_id defined: $item_id_defined ".
174
                                           "item_id defined: $item_id_defined ".
175
                                           "itemnumber defined: $itemnumber_defined" );
175
                                           "itemnumber defined: $itemnumber_defined" );
176
    }
176
    }
177
    else {
177
    else {
178
        Koha::Exceptions::Exception->throw("after_item_action called with action: $action, id: $item_id" ) if $item_id;
178
        Koha::Exception->throw("after_item_action called with action: $action, id: $item_id" ) if $item_id;
179
    }
179
    }
180
}
180
}
181
181
Lines 183-189 sub after_authority_action { Link Here
183
    my ( $self, $params ) = @_;
183
    my ( $self, $params ) = @_;
184
    my $action = $params->{action} // q{};
184
    my $action = $params->{action} // q{};
185
    my $id = $params->{authority_id} // 0;
185
    my $id = $params->{authority_id} // 0;
186
    Koha::Exceptions::Exception->throw("after_authority_action called with action: $action, id: $id");
186
    Koha::Exception->throw("after_authority_action called with action: $action, id: $id");
187
}
187
}
188
188
189
sub after_circ_action {
189
sub after_circ_action {
Lines 196-208 sub after_circ_action { Link Here
196
    my $type = $payload->{type};
196
    my $type = $payload->{type};
197
197
198
    if ( $action eq 'renewal' ) {
198
    if ( $action eq 'renewal' ) {
199
        Koha::Exceptions::Exception->throw("after_circ_action called with action: $action, ref: " . ref($checkout));
199
        Koha::Exception->throw("after_circ_action called with action: $action, ref: " . ref($checkout));
200
    }
200
    }
201
    elsif ( $action eq 'checkout') {
201
    elsif ( $action eq 'checkout') {
202
        Koha::Exceptions::Exception->throw("after_circ_action called with action: $action, ref: " . ref($checkout) . " type: $type");
202
        Koha::Exception->throw("after_circ_action called with action: $action, ref: " . ref($checkout) . " type: $type");
203
    }
203
    }
204
    elsif ( $action eq 'checkin' ) {
204
    elsif ( $action eq 'checkin' ) {
205
        Koha::Exceptions::Exception->throw("after_circ_action called with action: $action, ref: " . ref($checkout));
205
        Koha::Exception->throw("after_circ_action called with action: $action, ref: " . ref($checkout));
206
    }
206
    }
207
}
207
}
208
208
(-)a/t/lib/plugins/Koha/Plugin/TestItemBarcodeTransform.pm (-2 / +2 lines)
Lines 3-9 package Koha::Plugin::TestItemBarcodeTransform; Link Here
3
## It's good practice to use Modern::Perl
3
## It's good practice to use Modern::Perl
4
use Modern::Perl;
4
use Modern::Perl;
5
5
6
use Koha::Exceptions::Exception;
6
use Koha::Exception;
7
use Koha::Plugins::Tab;
7
use Koha::Plugins::Tab;
8
8
9
use Mojo::JSON qw( decode_json );
9
use Mojo::JSON qw( decode_json );
Lines 38-44 sub item_barcode_transform { Link Here
38
    if ( Scalar::Util::looks_like_number( $$barcode ) ) {
38
    if ( Scalar::Util::looks_like_number( $$barcode ) ) {
39
        $$barcode = $$barcode * 4
39
        $$barcode = $$barcode * 4
40
    }
40
    }
41
    Koha::Exceptions::Exception->throw("item_barcode_transform called with parameter: $param");
41
    Koha::Exception->throw("item_barcode_transform called with parameter: $param");
42
}
42
}
43
43
44
1;
44
1;
(-)a/tools/batchMod.pl (-2 / +1 lines)
Lines 32-38 use Encode qw( encode_utf8 ); Link Here
32
32
33
use Koha::Database;
33
use Koha::Database;
34
use Koha::DateUtils qw( dt_from_string );
34
use Koha::DateUtils qw( dt_from_string );
35
use Koha::Exceptions::Exception;
35
use Koha::Exception;
36
use Koha::Biblios;
36
use Koha::Biblios;
37
use Koha::Items;
37
use Koha::Items;
38
use Koha::Patrons;
38
use Koha::Patrons;
39
- 

Return to bug 29857