From 016f2797ee2dfea8948bbb1247eaa9fc5234a35a Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 24 Sep 2009 00:09:43 +0100 Subject: [PATCH] Dump bogus XML in _commodmap.xml if we can't parse it --- yarrg/commod-results-processor | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 $!; } -- 2.30.2