summaryrefslogtreecommitdiff
path: root/index.pl
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2015-09-20 20:21:59 +0200
committerDaniel Friesel <derf@finalrewind.org>2015-09-20 20:21:59 +0200
commit6015b42bc44f3eec29b2e74acc1d3445dd241d48 (patch)
treed6e0c48b07e75e6db4c8bef1b376f51da679f1b9 /index.pl
parent0181fdcc3a02d1cba65dcff1369c82a003d8ad94 (diff)
print error for unsupported backend, do not silently use ris
Diffstat (limited to 'index.pl')
-rw-r--r--index.pl8
1 files changed, 7 insertions, 1 deletions
diff --git a/index.pl b/index.pl
index dc689d5..f931d92 100644
--- a/index.pl
+++ b/index.pl
@@ -69,7 +69,7 @@ sub get_results_for {
};
$cache->freeze( $cache_str, $data );
}
- else {
+ elsif ( $backend eq 'ris' ) {
my $status = Travel::Status::DE::HAFAS->new(
station => $station,
excluded_mots => [qw[bus ferry ondemand tram u]],
@@ -81,6 +81,12 @@ sub get_results_for {
};
$cache->freeze( $cache_str, $data );
}
+ else {
+ $data = {
+ results => [],
+ errstr => "Backend '$backend' not supported",
+ };
+ }
}
return $data;