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
|
HasSucceeded bool
|
||||||
ExitCode int
|
ExitCode int
|
||||||
CmdOptions CommandOptions
|
CmdOptions CommandOptions
|
||||||
|
Error string
|
||||||
}
|
}
|
||||||
|
|
|
@ -192,6 +192,7 @@ func (cmd *LinuxCommand) Run() error {
|
||||||
}
|
}
|
||||||
exitInfo.HasSucceeded = false
|
exitInfo.HasSucceeded = false
|
||||||
exitInfo.ExitCode = exitErr.ExitCode()
|
exitInfo.ExitCode = exitErr.ExitCode()
|
||||||
|
exitInfo.Error = exitErr.Error()
|
||||||
err := h.(func(data EventExitData) error)(*exitInfo)
|
err := h.(func(data EventExitData) error)(*exitInfo)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("%s: %w", ErrRunningEvt.Error(), err)
|
return fmt.Errorf("%s: %w", ErrRunningEvt.Error(), err)
|
||||||
|
@ -205,6 +206,7 @@ func (cmd *LinuxCommand) Run() error {
|
||||||
}
|
}
|
||||||
exitInfo.HasSucceeded = false
|
exitInfo.HasSucceeded = false
|
||||||
exitInfo.ExitCode = exitErr.ExitCode()
|
exitInfo.ExitCode = exitErr.ExitCode()
|
||||||
|
exitInfo.Error = exitErr.Error()
|
||||||
err := h.(func(data EventExitData) error)(*exitInfo)
|
err := h.(func(data EventExitData) error)(*exitInfo)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("%s: %w", ErrRunningEvt.Error(), err)
|
return fmt.Errorf("%s: %w", ErrRunningEvt.Error(), err)
|
||||||
|
|
Loading…
Reference in a new issue