fix(mage): handle different types of errors
Some checks reported errors
continuous-integration/drone/push Build was killed
Some checks reported errors
continuous-integration/drone/push Build was killed
This commit is contained in:
parent
51cd2830dd
commit
8f473481ac
@ -79,8 +79,10 @@ func runCmdWithOutput(name string, arg ...string) (output []byte, err error) {
|
||||
cmd := exec.Command(name, arg...)
|
||||
output, err = cmd.Output()
|
||||
if err != nil {
|
||||
ee := err.(*exec.ExitError)
|
||||
return nil, fmt.Errorf("error running command: %s, %s", string(ee.Stderr), err)
|
||||
if ee, is := err.(*exec.ExitError); is {
|
||||
return nil, fmt.Errorf("error running command: %s, %s", string(ee.Stderr), err)
|
||||
}
|
||||
return nil, fmt.Errorf("error running command: %s", err)
|
||||
}
|
||||
|
||||
return output, nil
|
||||
|
Loading…
x
Reference in New Issue
Block a user