mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-22 07:11:01 +00:00
bubble up errors on command running
This commit is contained in:
parent
80af149b02
commit
0beb4dd4d4
1 changed files with 7 additions and 5 deletions
|
|
@ -26,7 +26,7 @@ func (gui *Gui) runSubprocessWithMessage(cmd *exec.Cmd, msg string) error {
|
|||
|
||||
gui.PauseBackgroundThreads = true
|
||||
|
||||
gui.runCommand(cmd, msg)
|
||||
err := gui.runCommand(cmd, msg)
|
||||
|
||||
if err := gui.g.Resume(); err != nil {
|
||||
return gui.createErrorPanel(err.Error())
|
||||
|
|
@ -34,7 +34,7 @@ func (gui *Gui) runSubprocessWithMessage(cmd *exec.Cmd, msg string) error {
|
|||
|
||||
gui.PauseBackgroundThreads = false
|
||||
|
||||
return nil
|
||||
return err
|
||||
}
|
||||
|
||||
func (gui *Gui) runCommand(cmd *exec.Cmd, msg string) {
|
||||
|
|
@ -58,9 +58,9 @@ func (gui *Gui) runCommand(cmd *exec.Cmd, msg string) {
|
|||
if msg != "" {
|
||||
fmt.Fprintf(os.Stdout, "\n%s\n\n", utils.ColoredString(msg, color.FgGreen))
|
||||
}
|
||||
if err := cmd.Run(); err != nil {
|
||||
// not handling the error explicitly because usually we're going to see it
|
||||
// in the output anyway
|
||||
err := cmd.Run()
|
||||
|
||||
if err != nil {
|
||||
gui.Log.Error(err)
|
||||
}
|
||||
|
||||
|
|
@ -69,4 +69,6 @@ func (gui *Gui) runCommand(cmd *exec.Cmd, msg string) {
|
|||
cmd.Stderr = io.Discard
|
||||
|
||||
gui.promptToReturn()
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue