From 43d4751563299e4634e73df72ca6c4103d1482ac Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 6 Feb 2025 10:42:57 +0000 Subject: [PATCH] Bug 39190: Start of recording status updates from abort --- Koha/File/Transport/SFTP.pm | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Koha/File/Transport/SFTP.pm b/Koha/File/Transport/SFTP.pm index 364c3405893..73755f22c38 100644 --- a/Koha/File/Transport/SFTP.pm +++ b/Koha/File/Transport/SFTP.pm @@ -287,16 +287,18 @@ sub _abort_operation { my $stderr = $self->{stderr_capture}; $self->{stderr_capture} = ''; + my $payload = { + status => $self->{connection}->status, + error => $self->{connection}->error, + path => $path ? $path : $self->{connection}->cwd, + error_raw => $stderr + }; + $self->add_message( { message => $operation, type => 'error', - payload => { - status => $self->{connection}->status, - error => $self->{connection}->error, - path => $path ? $path : $self->{connection}->cwd, - error_raw => $stderr - } + payload => $payload } ); @@ -304,6 +306,12 @@ sub _abort_operation { $self->{connection}->abort; } + my $status = { + status => 'errors', + operations => [ { code => $operation, status => 'error', detail => $payload } ] + }; + $self->set( { status => encode_json($status) } )->store(); + return; } -- 2.48.1