X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.db-live.git;a=blobdiff_plain;f=yarrg%2Fcommod-results-processor;fp=yarrg%2Fcommod-results-processor;h=36804d35d64c34f25f07fbb22a0de06ad8ee9454;hp=99c6924739391838729b35ea97e17463b83122ed;hb=016f2797ee2dfea8948bbb1247eaa9fc5234a35a;hpb=938b4dd547bfc4d9538a5714b6f21ab3da50d8d1 diff --git a/yarrg/commod-results-processor b/yarrg/commod-results-processor index 99c6924..36804d3 100755 --- a/yarrg/commod-results-processor +++ b/yarrg/commod-results-processor @@ -287,7 +287,16 @@ sub refresh_commodmap() { my $content= $resp->content; # print STDERR "[[[$content]]]\n"; - $xp->parse($content); + my $commodmapxmltmp= '_commodmap.xml'; + if (!eval { + $xp->parse($content); 1; + }) { + open R, ">./$commodmapxmltmp" or die $!; + print R $content or die $!; + close R or die $!; + die "$@ parsing commodmap"; + } + unlink $commodmapxmltmp or $!==&ENOENT or die $!; close $o or die $!; rename "_commodmap.tsv.tmp","_commodmap.tsv" or die $!; }