Revision 2772592d
Von Moritz Bunkus vor fast 14 Jahren hinzugefügt
SL/DB/BackgroundJob.pm | ||
---|---|---|
27 | 27 |
my $run_at = DateTime->now_local; |
28 | 28 |
my $history; |
29 | 29 |
|
30 |
eval { |
|
30 |
my $ok = eval {
|
|
31 | 31 |
my $result = $package->new->run($self); |
32 | 32 |
|
33 | 33 |
$history = SL::DB::BackgroundJobHistory |
... | ... | |
41 | 41 |
1; |
42 | 42 |
}; |
43 | 43 |
|
44 |
if ($EVAL_ERROR) {
|
|
44 |
if (!$ok) {
|
|
45 | 45 |
$history = SL::DB::BackgroundJobHistory |
46 | 46 |
->new(package_name => $self->package_name, |
47 | 47 |
run_at => $run_at, |
Auch abrufbar als: Unified diff
Richtiges Handling des Fehlerfalls von eval