From 96c0158b7acada5ade93743e1286e35eed33a3cf Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 20 Nov 2011 15:34:27 +0100 Subject: Recognized invalid place/name error messages --- lib/Travel/Status/DE/VRR.pm | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'lib/Travel/Status/DE') diff --git a/lib/Travel/Status/DE/VRR.pm b/lib/Travel/Status/DE/VRR.pm index ed97712..4617cbf 100644 --- a/lib/Travel/Status/DE/VRR.pm +++ b/lib/Travel/Status/DE/VRR.pm @@ -170,23 +170,30 @@ sub check_for_ambiguous { return; } - if ( $e_place->getAttribute('state') eq 'list' ) { + my $s_place = $e_place->getAttribute('state'); + my $s_name = $e_name->getAttribute('state'); + + if ( $s_place eq 'list' ) { $self->{errstr} = sprintf( 'Ambiguous place input: %s', join( q{ | }, map { decode( 'UTF-8', $_->textContent ) } @{ $e_place->findnodes($xp_place_elem) } ) ); - return; } - if ( $e_name->getAttribute('state') eq 'list' ) { + if ( $s_name eq 'list' ) { $self->{errstr} = sprintf( 'Ambiguous name input: %s', join( q{ | }, map { decode( 'UTF-8', $_->textContent ) } @{ $e_name->findnodes($xp_name_elem) } ) ); - return; + } + if ( $s_place eq 'notidentified' ) { + $self->{errstr} = 'invalid place parameter'; + } + if ( $s_name eq 'notidentified' ) { + $self->{errstr} = 'invalid name parameter'; } return; -- cgit v1.2.3