Skip to content
Snippets Groups Projects
Commit e6a8bc32 authored by bolkun's avatar bolkun
Browse files

Replaced croak with color error print and die function

parent 3a954450
No related branches found
No related tags found
1 merge request!5Feature error coloring
...@@ -205,7 +205,10 @@ package SLUB::LZA::SIPBuilderBagIt; ...@@ -205,7 +205,10 @@ package SLUB::LZA::SIPBuilderBagIt;
SLUB::LZA::SIPBuilderBagIt::write_file("DEBUG_${ppn}_catalog_response.xml", $response->decoded_content); SLUB::LZA::SIPBuilderBagIt::write_file("DEBUG_${ppn}_catalog_response.xml", $response->decoded_content);
} }
my $recordData = $xp->findnodes_as_string('/*[local-name()="searchRetrieveResponse"]/*[local-name()="records"]/*[local-name()="record"]/*[local-name()="recordData"]/*'); my $recordData = $xp->findnodes_as_string('/*[local-name()="searchRetrieveResponse"]/*[local-name()="records"]/*[local-name()="record"]/*[local-name()="recordData"]/*');
if (!$recordData) { croak("ERROR: Did not get any <recordData/> for PPN '$ppn' using '$sru'");} if (!$recordData) {
print_scalar_data("", "ERROR: did not get any <recordData/> for PPN '$ppn' using '$sru'", "", "red");
die();
}
my $marc_doc = $parser->parse_string($recordData); my $marc_doc = $parser->parse_string($recordData);
add_marc21_schema_location($marc_doc); add_marc21_schema_location($marc_doc);
if ($with_debug) { if ($with_debug) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment