log error when trip_id is missing

This commit is contained in:
Daniel Friesel 2020-10-01 19:52:11 +02:00
parent 64c9b5b160
commit 8d53f7f5c8
2 changed files with 7 additions and 2 deletions

View file

@ -265,8 +265,12 @@ sub run {
my $trip_id = $candidate->{journey_data}{trip_id}; my $trip_id = $candidate->{journey_data}{trip_id};
if ( not $trip_id ) { if ( not $trip_id ) {
$self->app->log->debug("... trip_id is missing"); $self->app->log->debug("... trip_id is missing");
$self->app->traewelling->log(
# TODO log traewelling error uid => $candidate->{uid},
message =>
"Fehler bei $opt{train_type} $opt{train_no}: Keine trip_id vorhanden",
is_error => 1
);
return; return;
} }
if ( $candidate->{data}{latest_push_ts} if ( $candidate->{data}{latest_push_ts}

View file

@ -285,6 +285,7 @@ sub checkin {
$opt{dep_eva} $opt{dep_eva}
); );
# Work around https://github.com/Traewelling/traewelling/issues/72
$self->{user_agent}->request_timeout(20) $self->{user_agent}->request_timeout(20)
->get_p( ->get_p(
"https://traewelling.de/api/v0/trains/trip?$trip_req" => $header ) "https://traewelling.de/api/v0/trains/trip?$trip_req" => $header )