add error message to failing commands *facepalm*
This commit is contained in:
parent
8c22105cf2
commit
88c55d3d73
2 changed files with 3 additions and 0 deletions
|
@ -14,4 +14,5 @@ type EventExitData struct {
|
|||
HasSucceeded bool
|
||||
ExitCode int
|
||||
CmdOptions CommandOptions
|
||||
Error string
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue