X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/f82c616366833bcef7b1298a550528e5226e0a1c..8a2864964b908cf0e30b361b4e3d4e9a864e35d4:/SL/BackgroundJob/ConvertTimeRecordings.pm diff --git a/SL/BackgroundJob/ConvertTimeRecordings.pm b/SL/BackgroundJob/ConvertTimeRecordings.pm index f39ac1ab0..ccea31a74 100644 --- a/SL/BackgroundJob/ConvertTimeRecordings.pm +++ b/SL/BackgroundJob/ConvertTimeRecordings.pm @@ -13,7 +13,6 @@ use SL::Locale::String qw(t8); use DateTime; use List::Util qw(any); -use Try::Tiny; sub create_job { $_[0]->create_standard_job('7 3 1 * *'); # every first day of month at 03:07 @@ -62,13 +61,8 @@ sub run { # TODO get/set see above my $from_date; my $to_date; - # handle errors with a catch handler - try { - $from_date = DateTime->from_kivitendo($self->data->{from_date}) if $self->data->{from_date}; - $to_date = DateTime->from_kivitendo($self->data->{to_date}) if $self->data->{to_date}; - } catch { - die "Cannot convert date from string $self->data->{from_date} $self->data->{to_date}\n Details :\n $_"; # not $@ - }; + $from_date = DateTime->from_kivitendo($self->data->{from_date}) if $self->data->{from_date}; + $to_date = DateTime->from_kivitendo($self->data->{to_date}) if $self->data->{to_date}; $from_date ||= DateTime->new( day => 1, month => DateTime->today_local->month, year => DateTime->today_local->year)->subtract(months => 1); $to_date ||= DateTime->last_day_of_month(month => DateTime->today_local->month, year => DateTime->today_local->year)->subtract(months => 1);