From: Tara L Andrews Date: Thu, 19 Apr 2012 09:47:55 +0000 (+0200) Subject: avoid dying on relationship conflicts X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=00c5bf0b057ec7822786a9e3b7141fc0fa629350;p=scpubgit%2Fstemmatology.git avoid dying on relationship conflicts --- diff --git a/lib/Text/Tradition/Parser/Self.pm b/lib/Text/Tradition/Parser/Self.pm index b8f12dd..432d8a3 100644 --- a/lib/Text/Tradition/Parser/Self.pm +++ b/lib/Text/Tradition/Parser/Self.pm @@ -3,6 +3,7 @@ package Text::Tradition::Parser::Self; use strict; use warnings; use Text::Tradition::Parser::GraphML qw/ graphml_parse /; +use TryCatch; =head1 NAME @@ -224,7 +225,11 @@ sub parse { $rel_exists = 1; } } - $collation->add_relationship( $from, $to, $e ) unless $rel_exists; + try { + $collation->add_relationship( $from, $to, $e ) unless $rel_exists; + } catch( Text::Tradition::Error $e ) { + warn "DROPPING $from -> $to: " . $e->message; + } } # Save the text for each witness so that we can ensure consistency