diff --git a/linux/events.go b/linux/events.go index f8168b5..76fe279 100644 --- a/linux/events.go +++ b/linux/events.go @@ -14,4 +14,5 @@ type EventExitData struct { HasSucceeded bool ExitCode int CmdOptions CommandOptions + Error string } diff --git a/linux/run.go b/linux/run.go index 232fee4..ddc3833 100644 --- a/linux/run.go +++ b/linux/run.go @@ -192,6 +192,7 @@ func (cmd *LinuxCommand) Run() error { } exitInfo.HasSucceeded = false exitInfo.ExitCode = exitErr.ExitCode() + exitInfo.Error = exitErr.Error() err := h.(func(data EventExitData) error)(*exitInfo) if err != nil { return fmt.Errorf("%s: %w", ErrRunningEvt.Error(), err) @@ -205,6 +206,7 @@ func (cmd *LinuxCommand) Run() error { } exitInfo.HasSucceeded = false exitInfo.ExitCode = exitErr.ExitCode() + exitInfo.Error = exitErr.Error() err := h.(func(data EventExitData) error)(*exitInfo) if err != nil { return fmt.Errorf("%s: %w", ErrRunningEvt.Error(), err)