Work: Include backend in debug and error messages

This commit is contained in:
Birte Kristina Friesel 2024-09-01 11:39:22 +02:00
parent 0f44f8695d
commit 02555f5c2f
No known key found for this signature in database
GPG key ID: 19E6E524EBB177BA

View file

@ -136,10 +136,14 @@ sub run {
=~ m{svcResL\[0\][.]err is (?:FAIL|PARAMETER)$} ) =~ m{svcResL\[0\][.]err is (?:FAIL|PARAMETER)$} )
{ {
# HAFAS do be weird. These are not actionable. # 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 { else {
$self->app->log->error("work($uid)/journey: $err"); $self->app->log->error(
"work($uid) @ HAFAS $entry->{backend_name}: journey: $err"
);
} }
} }
)->wait; )->wait;
@ -159,7 +163,8 @@ sub run {
}; };
if ($@) { if ($@) {
$errors += 1; $errors += 1;
$self->app->log->error("work($uid)/hafas: $@"); $self->app->log->error(
"work($uid) @ HAFAS $entry->{backend_name}: $@");
} }
next; next;
} }
@ -245,7 +250,7 @@ sub run {
}; };
if ($@) { if ($@) {
$errors += 1; $errors += 1;
$self->app->log->error("work($uid)/departure: $@"); $self->app->log->error("work($uid) @ IRIS: departure: $@");
} }
eval { eval {
@ -335,14 +340,15 @@ sub run {
)->catch( )->catch(
sub { sub {
my ($error) = @_; my ($error) = @_;
$self->app->log->error("work($uid)/arrival: $error"); $self->app->log->error(
"work($uid) @ IRIS: arrival: $error");
$errors += 1; $errors += 1;
} }
)->wait; )->wait;
} }
}; };
if ($@) { if ($@) {
$self->app->log->error("work($uid)/arrival: $@"); $self->app->log->error("work($uid) @ IRIS: arrival: $@");
$errors += 1; $errors += 1;
} }