From 2772592dab54533eb91a0d11ade01ed24cc58d19 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 12 Jan 2011 15:10:56 +0100 Subject: [PATCH] Richtiges Handling des Fehlerfalls von eval --- SL/DB/BackgroundJob.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SL/DB/BackgroundJob.pm b/SL/DB/BackgroundJob.pm index b9e00c4d3..8945cebac 100644 --- a/SL/DB/BackgroundJob.pm +++ b/SL/DB/BackgroundJob.pm @@ -27,7 +27,7 @@ sub run { my $run_at = DateTime->now_local; my $history; - eval { + my $ok = eval { my $result = $package->new->run($self); $history = SL::DB::BackgroundJobHistory @@ -41,7 +41,7 @@ sub run { 1; }; - if ($EVAL_ERROR) { + if (!$ok) { $history = SL::DB::BackgroundJobHistory ->new(package_name => $self->package_name, run_at => $run_at, -- 2.20.1