[Koha-bugs] [Bug 32393] background job worker explodes if JSON is incorrect
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Wed Jan 4 12:16:01 CET 2023
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32393
Jonathan Druart <jonathan.druart+koha at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|Failed QA |Needs Signoff
--- Comment #6 from Jonathan Druart <jonathan.druart+koha at gmail.com> ---
(In reply to Tomás Cohen Arazi from comment #5)
> Hi
>
> I tried this:
>
> kohadev-koha at kohadevbox:/kohadevbox/koha$ perl -MTry::Tiny -e 'try { die
> "Boo"; } catch { warn "catch"; } finally { warn "finally" if $@; };'
> catch at -e line 1.
> kohadev-koha at kohadevbox:/kohadevbox/koha$ perl -MTry::Tiny -e 'try { die
> "Boo"; } catch { warn "catch"; } finally { warn "finally" if $_; };'
> catch at -e line 1.
>
>
> In both cases it never prints "finally", so I guess the error buffer is
> cleared after the catch block. Do you think it would work if we just move
> the $job->status('failed') to the catch block? It looks cleaner too.
It's @_
% perl -MTry::Tiny -e 'try { die "Boo"; } catch { warn "catch"; } finally {
warn "finally" if @_; };'
catch at -e line 1.
finally at -e line 1.
IMO it's better in the finally block, in case we add more stuff in catch later.
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list