mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-25 12:24:47 +02:00
better error handling for commands
This commit is contained in:
parent
04d5a473d7
commit
865809e625
@ -90,6 +90,9 @@ func sanitisedCommandOutput(output []byte, err error) (string, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
// errors like 'exit status 1' are not very useful so we'll create an error
|
// errors like 'exit status 1' are not very useful so we'll create an error
|
||||||
// from the combined output
|
// from the combined output
|
||||||
|
if outputString == "" {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
return outputString, errors.New(outputString)
|
return outputString, errors.New(outputString)
|
||||||
}
|
}
|
||||||
return outputString, nil
|
return outputString, nil
|
||||||
@ -111,7 +114,7 @@ func (c *OSCommand) OpenFile(filename string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
command := utils.ResolvePlaceholderString(commandTemplate, templateValues)
|
command := utils.ResolvePlaceholderString(commandTemplate, templateValues)
|
||||||
err := c.RunCommand(command)
|
_, err := c.RunCommandWithOutput(command)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user