summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/events2md.pl10
1 files changed, 7 insertions, 3 deletions
diff --git a/bin/events2md.pl b/bin/events2md.pl
index 9c10ce0..32e057d 100755
--- a/bin/events2md.pl
+++ b/bin/events2md.pl
@@ -5,6 +5,7 @@ use utf8;
use open qw(:std :encoding(UTF-8));
use strictures;
use autodie;
+use Feature::Compat::Try;
use POSIX qw(locale_h);
use locale;
@@ -21,7 +22,6 @@ use IO::Prompter;
use Cal::DAV;
use Data::ICal::DateTime;
use DateTime;
-use Try::Tiny;
use Path::Tiny;
if ( IO::Interactive::Tiny::is_interactive() ) {
@@ -182,8 +182,12 @@ sub print_event
my %attachments;
if ( $entry->property('attach') ) {
for ( @{ $entry->property('attach') } ) {
- my $uri = try { URI->new( $_->value ) }
- or next;
+ my $uri;
+ try { $uri = URI->new( $_->value ) }
+ catch ($e) {
+ $log->errorf( 'failed to parse URI %s: %s', $uri, $e );
+ next;
+ }
$uri->authority and $uri->host
or next;
push @{ $attachments{ $uri->host } }, $uri;