summaryrefslogtreecommitdiff
path: root/lib/DBInfoscreen/Helper
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2020-12-06 11:31:01 +0100
committerDaniel Friesel <derf@finalrewind.org>2020-12-06 11:31:01 +0100
commit7e2a180398594aae2671567fb3ce8e3790beef5d (patch)
tree4b1307f0d720006b245ec691b476bdc9417287d6 /lib/DBInfoscreen/Helper
parent13e307081e3ee411353ef9248b8b0b8d523a0d6c (diff)
get_polyline_p: Handle HTTP errors3.5.1
Diffstat (limited to 'lib/DBInfoscreen/Helper')
-rw-r--r--lib/DBInfoscreen/Helper/HAFAS.pm10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/DBInfoscreen/Helper/HAFAS.pm b/lib/DBInfoscreen/Helper/HAFAS.pm
index fd688db..e270a3e 100644
--- a/lib/DBInfoscreen/Helper/HAFAS.pm
+++ b/lib/DBInfoscreen/Helper/HAFAS.pm
@@ -378,6 +378,16 @@ sub get_polyline_p {
->then(
sub {
my ($tx) = @_;
+
+ if ( my $err = $tx->error ) {
+ $self->{log}->warn(
+"hafas->get_polyline_p($url): HTTP $err->{code} $err->{message}"
+ );
+ $promise->reject(
+ "GET $url returned HTTP $err->{code} $err->{message}");
+ return;
+ }
+
$self->{log}->debug("GET $url (OK)");
my $json = decode_json( $tx->res->body );
my @coordinate_list;