From 0a01de6e687a5e4bd03f21169bb6dc6b05833bb7 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 11 Dec 2022 16:31:31 +0100 Subject: new_p: handle unknown EVA IDs --- lib/Travel/Status/DE/IRIS.pm | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/Travel/Status') diff --git a/lib/Travel/Status/DE/IRIS.pm b/lib/Travel/Status/DE/IRIS.pm index 3b1ff47..1f364ac 100644 --- a/lib/Travel/Status/DE/IRIS.pm +++ b/lib/Travel/Status/DE/IRIS.pm @@ -54,6 +54,15 @@ sub new_p { my @candidates = $opt{get_station}( $opt{station} ); + if ( @candidates != 1 and $opt{station} =~ m{^\d+$} ) { + @candidates = ( + [ + "D$opt{station}", "Betriebsstelle nicht bekannt $opt{station}", + $opt{station} + ] + ); + } + if ( @candidates == 0 ) { return $promise->reject('station not found'); } -- cgit v1.2.3