From: Moritz Bunkus Date: Wed, 12 Jan 2011 14:10:56 +0000 (+0100) Subject: Richtiges Handling des Fehlerfalls von eval X-Git-Tag: release-2.6.3~61^2~7^2~1^2~2^2~100 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=2772592dab54533eb91a0d11ade01ed24cc58d19;p=kivitendo-erp.git Richtiges Handling des Fehlerfalls von eval --- 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,