summaryrefslogtreecommitdiff
path: root/lib/Travel
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-11-30 21:47:56 +0100
committerDaniel Friesel <derf@finalrewind.org>2011-11-30 21:47:56 +0100
commit316d373be0167ba84a4e6c08cca02fa2ef8c2c65 (patch)
tree7efb0916bc58ab908442239945c339934b26cfaf /lib/Travel
parente1a7eefbb36126b925e78b9f7acd3ac9a086e85c (diff)
catch other errors
Diffstat (limited to 'lib/Travel')
-rw-r--r--lib/Travel/Status/DE/VRR.pm11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Travel/Status/DE/VRR.pm b/lib/Travel/Status/DE/VRR.pm
index 5fdef27..fe6c941 100644
--- a/lib/Travel/Status/DE/VRR.pm
+++ b/lib/Travel/Status/DE/VRR.pm
@@ -156,12 +156,15 @@ sub check_for_ambiguous {
my $xp_place = XML::LibXML::XPathExpression->new('//itdOdv/itdOdvPlace');
my $xp_name = XML::LibXML::XPathExpression->new('//itdOdv/itdOdvName');
+ my $xp_mesg
+ = XML::LibXML::XPathExpression->new('//itdMessage[@type="error"]');
my $xp_place_elem = XML::LibXML::XPathExpression->new('./odvPlaceElem');
my $xp_name_elem = XML::LibXML::XPathExpression->new('./odvNameElem');
my $e_place = ( $xml->findnodes($xp_place) )[0];
my $e_name = ( $xml->findnodes($xp_name) )[0];
+ my @e_mesg = $xml->findnodes($xp_mesg);
if ( not( $e_place and $e_name ) ) {
@@ -180,6 +183,7 @@ sub check_for_ambiguous {
map { decode( 'UTF-8', $_->textContent ) }
@{ $e_place->findnodes($xp_place_elem) } )
);
+ return;
}
if ( $s_name eq 'list' ) {
$self->{errstr} = sprintf(
@@ -188,12 +192,19 @@ sub check_for_ambiguous {
map { decode( 'UTF-8', $_->textContent ) }
@{ $e_name->findnodes($xp_name_elem) } )
);
+ return;
}
if ( $s_place eq 'notidentified' ) {
$self->{errstr} = 'invalid place parameter';
+ return;
}
if ( $s_name eq 'notidentified' ) {
$self->{errstr} = 'invalid name parameter';
+ return;
+ }
+ if (@e_mesg) {
+ $self->{errstr} = join( q{; }, map { $_->textContent } @e_mesg );
+ return;
}
return;