From 8a2864964b908cf0e30b361b4e3d4e9a864e35d4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Tue, 4 May 2021 21:18:35 +0200 Subject: [PATCH] Revert "CTR: Benutzereingabe in data mit Try::Tiny auffangen" DateTime->from_kivitindeo wirft keine Ausnahme, daher ist hier try/catch ohne Funktion. This reverts commit a6291ceb5b16c6faf4e24c6d1a5516f06df58e22. --- SL/BackgroundJob/ConvertTimeRecordings.pm | 10 ++-------- SL/InstallationCheck.pm | 1 - 2 files changed, 2 insertions(+), 9 deletions(-) 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); diff --git a/SL/InstallationCheck.pm b/SL/InstallationCheck.pm index 11098970e..fedc58898 100644 --- a/SL/InstallationCheck.pm +++ b/SL/InstallationCheck.pm @@ -63,7 +63,6 @@ BEGIN { { name => "Text::CSV_XS", version => '0.23', url => "http://search.cpan.org/~hmbrand/", debian => 'libtext-csv-xs-perl' }, { name => "Text::Iconv", version => '1.2', url => "http://search.cpan.org/~mpiotr/", debian => 'libtext-iconv-perl' }, { name => "Text::Unidecode", url => "http://search.cpan.org/~sburke/", debian => 'libtext-unidecode-perl' }, - { name => "Try::Tiny", url => "https://metacpan.org/release/Try-Tiny", debian => 'libtry-tiny-perl' }, { name => "URI", version => '1.35', url => "http://search.cpan.org/~gaas/", debian => 'liburi-perl' }, { name => "XML::LibXML", url => "https://metacpan.org/pod/XML::LibXML", debian => 'libxml-libxml-perl' }, { name => "XML::Writer", version => '0.602', url => "http://search.cpan.org/~josephw/", debian => 'libxml-writer-perl' }, -- 2.20.1