diff options
author | Daniel Friesel <derf@finalrewind.org> | 2015-09-16 15:03:47 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2015-09-16 15:03:47 +0200 |
commit | 9a51e8630e8b4a2978b07e7cc859c85c3e703c2e (patch) | |
tree | 941772a94ab3ab4d2825a3774fd3e372fb0b31ac /lib/Travel/Status/DE | |
parent | 86ade9b0a956e25a201d56827e0b4935db036578 (diff) |
HAFAS->new: Die if an unknown service is requested
Diffstat (limited to 'lib/Travel/Status/DE')
-rw-r--r-- | lib/Travel/Status/DE/HAFAS.pm | 4 |
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}, |