summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Travel/Status/DE/IRIS.pm18
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/Travel/Status/DE/IRIS.pm b/lib/Travel/Status/DE/IRIS.pm
index 6cdf092..4461e01 100644
--- a/lib/Travel/Status/DE/IRIS.pm
+++ b/lib/Travel/Status/DE/IRIS.pm
@@ -173,8 +173,15 @@ sub get_station {
= $self->get_with_cache( $self->{main_cache},
$self->{iris_base} . '/station/' . $station );
if ($err) {
- $self->{errstr} = "Failed to fetch station data: $err";
- return;
+ if ( $opt{root} ) {
+ $self->{errstr} = "Failed to fetch station data: $err";
+ return;
+ }
+ else {
+ $self->{warnstr}
+ = "Failed to fetch station data for '$station': $err\n";
+ next;
+ }
}
my $xml_st = XML::LibXML->load_xml( string => $raw );
@@ -184,9 +191,14 @@ sub get_station {
if ( not $station_node ) {
if ( $opt{root} ) {
$self->{errstr}
- = "The station '$opt{name}' has no associated timetable";
+ = "Station '$station' has no associated timetable";
return;
}
+ else {
+ $self->{warnstr}
+ = "Station '$station' has no associated timetable";
+ next;
+ }
next;
}