log requested station when throwing an ambiguous station name error

This commit is contained in:
Daniel Friesel 2022-08-01 20:03:34 +02:00
parent d3c8daf84c
commit c348b2dff8
No known key found for this signature in database
GPG key ID: 100D5BFB5166E005

View file

@ -64,7 +64,8 @@ sub get_departures {
elsif ( @station_matches > 1 ) { elsif ( @station_matches > 1 ) {
return { return {
results => [], results => [],
errstr => 'Mehrdeutiger Stationsname. Mögliche Eingaben: ' errstr =>
"Mehrdeutiger Stationsname: '$station'. Mögliche Eingaben: "
. join( q{, }, map { $_->[1] } @station_matches ), . join( q{, }, map { $_->[1] } @station_matches ),
}; };
} }
@ -150,7 +151,8 @@ sub get_departures_p {
return Mojo::Promise->reject( return Mojo::Promise->reject(
{ {
results => [], results => [],
errstr => 'Mehrdeutiger Stationsname. Mögliche Eingaben: ' errstr =>
"Mehrdeutiger Stationsname: '$station'. Mögliche Eingaben: "
. join( q{, }, map { $_->[1] } @station_matches ), . join( q{, }, map { $_->[1] } @station_matches ),
} }
); );