diff options
author | Daniel Friesel <derf@finalrewind.org> | 2011-11-20 15:34:27 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2011-11-20 15:34:27 +0100 |
commit | 96c0158b7acada5ade93743e1286e35eed33a3cf (patch) | |
tree | fb63490231d0a8c0e77283a9bb2db7b7194d7fc7 /lib | |
parent | 5a0c0125a8e21f87fa667c5ee33e52597d6b51ef (diff) |
Recognized invalid place/name error messages
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Travel/Status/DE/VRR.pm | 15 |
1 files changed, 11 insertions, 4 deletions
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; |