diff --git a/bin/slubsipbuilderbagit.pl b/bin/slubsipbuilderbagit.pl index 956165c1d326844d28b51f31163c233c4cbef824..758225af9e8903ea5fd3f639d9ad3019b3012417 100644 --- a/bin/slubsipbuilderbagit.pl +++ b/bin/slubsipbuilderbagit.pl @@ -68,7 +68,6 @@ package SLUB::LZA::SIPBuilderBagIt; use MARC::Record; use Path::Tiny; use Term::ANSIColor; # colored print - use Try::Tiny; use XML::LibXML; use XML::XPath; @@ -327,12 +326,13 @@ package SLUB::LZA::SIPBuilderBagIt; my $parser = XML::LibXML->new; my $doc = $parser->parse_file($rightsFilePath); - my $success = try { $schema->validate($doc); 1 } catch {}; - if ($success) { - return 1; - } else { + eval { + $schema->validate($doc); + }; + if ($@) { # error die "File $rightsName failed validation: $@"; }; + return 1; } sub print_scalar_data($$$$){