[Koha-bugs] [Bug 35843] New: No such thing as Koha::Exceptions::Exception
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Fri Jan 19 09:51:04 CET 2024
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35843
Bug ID: 35843
Summary: No such thing as Koha::Exceptions::Exception
Change sponsored?: ---
Product: Koha
Version: master
Hardware: All
OS: All
Status: NEW
Severity: major
Priority: P5 - low
Component: Architecture, internals, and plumbing
Assignee: koha-bugs at lists.koha-community.org
Reporter: magnus at libriotech.no
QA Contact: testopia at bugs.koha-community.org
On Koha 22.11.04-1 installed with the Debian packages I have some background
jobs that are failing, and I see this in the logs:
==> /var/log/koha/mykoha/plack-intranet-error.log <==
[2024/01/19 08:47:02] [WARN] The job has not been sent to the message broker:
(Can't locate object method "throw" via package "Koha::Exceptions::Exception"
(perhaps you forgot to load "Koha::Exceptions::Exception"?) at
/usr/share/koha/lib/Koha/BackgroundJob.pm line 141.
) at /usr/share/koha/lib/Koha/BackgroundJob.pm line 148.
The relevant code looks like this:
134 try {
135 # This namespace is wrong, it must be a vhost instead.
136 # But to do so it needs to be created on the server => much more
work when a new Koha instance is created.
137 # Also, here we just want the Koha instance's name, but it's not in
the config...
138 # Picking a random id (memcached_namespace) from the config
139 my $namespace = C4::Context->config('memcached_namespace');
140 my $encoded_args = Encode::encode_utf8( $json_args ); # FIXME We
should better leave this to Net::Stomp?
141 $conn->send_with_receipt( { destination => sprintf("/queue/%s-%s",
$namespace, $job_queue), body => $encoded_args } )
142 or Koha::Exceptions::Exception->throw('Job has not been
enqueued');
143 } catch {
144 $self->status('failed')->store;
145 if ( ref($_) eq 'Koha::Exceptions::Exception' ) {
146 $_->rethrow;
147 } else {
148 warn sprintf "The job has not been sent to the message broker:
(%s)", $_;
149 }
150 };
This code is the only place Koha::Exceptions::Exception is mentioned in the
code:
$ sudo grep -rn "Koha::Exceptions::Exception" /usr/share/koha/
/usr/share/koha/lib/Koha/BackgroundJob.pm:142: or
Koha::Exceptions::Exception->throw('Job has not been enqueued');
/usr/share/koha/lib/Koha/BackgroundJob.pm:145: if ( ref($_) eq
'Koha::Exceptions::Exception' ) {
--
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
More information about the Koha-bugs
mailing list