Skip to content
Snippets Groups Projects
Commit ca646c68 authored by Jens Steidl's avatar Jens Steidl :baby_chick:
Browse files

- refactor: use eval to reduce library dependencies

parent 323ce9f1
No related branches found
No related tags found
No related merge requests found
......@@ -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($$$$){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment