Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct command runner error message #1197

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkg/workceptor/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,9 +432,9 @@
err := commandRunner(cfg.Command, cfg.Params, cfg.UnitDir)
if err != nil {
statusFilename := path.Join(cfg.UnitDir, "status")
err = (&StatusFileData{}).UpdateBasicStatus(statusFilename, WorkStateFailed, err.Error(), stdoutSize(cfg.UnitDir))
if err != nil {
MainInstance.nc.GetLogger().Error("Error updating status file %s: %s", statusFilename, err)
err2 := (&StatusFileData{}).UpdateBasicStatus(statusFilename, WorkStateFailed, err.Error(), stdoutSize(cfg.UnitDir))
if err2 != nil {
MainInstance.nc.GetLogger().Error("Error updating status file %s: %s", statusFilename, err2)

Check warning on line 437 in pkg/workceptor/command.go

View check run for this annotation

Codecov / codecov/patch

pkg/workceptor/command.go#L435-L437

Added lines #L435 - L437 were not covered by tests
}
MainInstance.nc.GetLogger().Error("Command runner exited with error: %s\n", err)
os.Exit(-1)
Expand Down