fix(process): leave exit action error unset

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Virgil 2026-03-31 19:59:32 +00:00
parent 3a60b9f1e7
commit 1a6a74085e
2 changed files with 3 additions and 2 deletions

View file

@ -224,7 +224,7 @@ func (s *Service) StartWithOptions(ctx context.Context, opts RunOptions) core.Re
waitErr := cmd.Wait()
duration := time.Since(proc.StartedAt)
status, exitCode, actionErr, killedSignal := classifyProcessExit(proc, waitErr)
status, exitCode, _, killedSignal := classifyProcessExit(proc, waitErr)
proc.mu.Lock()
proc.PID = cmd.Process.Pid
@ -242,7 +242,7 @@ func (s *Service) StartWithOptions(ctx context.Context, opts RunOptions) core.Re
ID: id,
ExitCode: exitCode,
Duration: duration,
Error: actionErr,
Error: nil,
})
}()

View file

@ -474,6 +474,7 @@ func TestService_Actions_Good(t *testing.T) {
assert.Len(t, exited, 1)
assert.Equal(t, 0, exited[0].ExitCode)
assert.Nil(t, exited[0].Error)
})
t.Run("broadcasts killed event", func(t *testing.T) {