diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2024-08-15 17:03:02 +0200 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2024-08-15 17:03:02 +0200 |
commit | d156e3389ee4786b0f8dc3b6a4cc9da1245109b8 (patch) | |
tree | 4fafe2a7e4d12685fa473bd91e87b0f14d6e21fa | |
parent | 119f2ea96ac28ffb008f073bf9b3e02840991183 (diff) |
HAFAS: add debug output for HAFAS requests and caching2.8.20
-rw-r--r-- | lib/Travelynx/Helper/HAFAS.pm | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Travelynx/Helper/HAFAS.pm b/lib/Travelynx/Helper/HAFAS.pm index 40bc636..a8ab395 100644 --- a/lib/Travelynx/Helper/HAFAS.pm +++ b/lib/Travelynx/Helper/HAFAS.pm @@ -142,11 +142,14 @@ sub get_tripid_p { my @results = $hafas->results; if ( not @results ) { + $self->{log}->debug("get_tripid_p($train_desc): no results"); $promise->reject( "journeyMatch($train_desc) returned no results"); return; } + $self->{log}->debug("get_tripid_p($train_desc): success"); + my $result = $results[0]; if ( @results > 1 ) { for my $journey (@results) { @@ -163,6 +166,7 @@ sub get_tripid_p { )->catch( sub { my ($err) = @_; + $self->{log}->debug("get_tripid_p($train_desc): error $err"); $promise->reject($err); return; } @@ -192,15 +196,18 @@ sub get_journey_p { my $journey = $hafas->result; if ($journey) { + $self->{log}->debug("get_journey_p($opt{trip_id}): success"); $promise->resolve($journey); return; } + $self->{log}->debug("get_journey_p($opt{trip_id}): no journey"); $promise->reject('no journey'); return; } )->catch( sub { my ($err) = @_; + $self->{log}->debug("get_journey_p($opt{trip_id}): error $err"); $promise->reject($err); return; } @@ -311,12 +318,14 @@ sub get_route_p { } } + $self->{log}->debug("get_route_p($opt{trip_id}): success"); $promise->resolve( $ret, $journey, $polyline ); return; } )->catch( sub { my ($err) = @_; + $self->{log}->debug("get_route_p($opt{trip_id}): error $err"); $promise->reject($err); return; } |