Skip to content

Commit

Permalink
Work: Include backend in debug and error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
derf committed Sep 1, 2024
1 parent 0f44f86 commit 02555f5
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions lib/Travelynx/Command/work.pm
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,14 @@ sub run {
=~ m{svcResL\[0\][.]err is (?:FAIL|PARAMETER)$} )
{
# HAFAS do be weird. These are not actionable.
$self->app->log->debug("work($uid)/journey: $err");
$self->app->log->debug(
"work($uid) @ HAFAS $entry->{backend_name}: journey: $err"
);
}
else {
$self->app->log->error("work($uid)/journey: $err");
$self->app->log->error(
"work($uid) @ HAFAS $entry->{backend_name}: journey: $err"
);
}
}
)->wait;
Expand All @@ -159,7 +163,8 @@ sub run {
};
if ($@) {
$errors += 1;
$self->app->log->error("work($uid)/hafas: $@");
$self->app->log->error(
"work($uid) @ HAFAS $entry->{backend_name}: $@");
}
next;
}
Expand Down Expand Up @@ -245,7 +250,7 @@ sub run {
};
if ($@) {
$errors += 1;
$self->app->log->error("work($uid)/departure: $@");
$self->app->log->error("work($uid) @ IRIS: departure: $@");
}

eval {
Expand Down Expand Up @@ -335,14 +340,15 @@ sub run {
)->catch(
sub {
my ($error) = @_;
$self->app->log->error("work($uid)/arrival: $error");
$self->app->log->error(
"work($uid) @ IRIS: arrival: $error");
$errors += 1;
}
)->wait;
}
};
if ($@) {
$self->app->log->error("work($uid)/arrival: $@");
$self->app->log->error("work($uid) @ IRIS: arrival: $@");
$errors += 1;
}

Expand Down

0 comments on commit 02555f5

Please sign in to comment.