summaryrefslogtreecommitdiff
path: root/lib/Travel
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2015-09-16 15:03:47 +0200
committerDaniel Friesel <derf@finalrewind.org>2015-09-16 15:03:47 +0200
commit9a51e8630e8b4a2978b07e7cc859c85c3e703c2e (patch)
tree941772a94ab3ab4d2825a3774fd3e372fb0b31ac /lib/Travel
parent86ade9b0a956e25a201d56827e0b4935db036578 (diff)
HAFAS->new: Die if an unknown service is requested
Diffstat (limited to 'lib/Travel')
-rw-r--r--lib/Travel/Status/DE/HAFAS.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Travel/Status/DE/HAFAS.pm b/lib/Travel/Status/DE/HAFAS.pm
index c67ac8d..21b0684 100644
--- a/lib/Travel/Status/DE/HAFAS.pm
+++ b/lib/Travel/Status/DE/HAFAS.pm
@@ -108,6 +108,10 @@ sub new {
$service = 'DB';
}
+ if ( defined $service and not exists $hafas_instance{$service} ) {
+ confess("The service '$service' is not supported");
+ }
+
my $ref = {
active_service => $service,
developer_mode => $conf{developer_mode},