Bug 39190: Start of recording status updates from abort

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Martin Renvoize 2025-02-06 10:42:57 +00:00 committed by Lucas Gass
parent 752ab95313
commit b701fed04c
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 14 additions and 6 deletions

View File

@ -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;
}