mirror of
https://github.com/net-byte/vtun
synced 2024-03-14 10:50:03 +08:00
Merge pull request #102 from hulucc/master
fix: better command err info
This commit is contained in:
commit
cedf869df9
@ -200,7 +200,11 @@ func ExecCmd(c string, args ...string) string {
|
||||
cmd := exec.Command(c, args...)
|
||||
out, err := cmd.Output()
|
||||
if err != nil {
|
||||
log.Println("failed to exec cmd:", err)
|
||||
if exitErr, ok := err.(*exec.ExitError); ok {
|
||||
log.Println("failed to exec cmd:", err, string(exitErr.Stderr))
|
||||
} else {
|
||||
log.Println("failed to exec cmd:", err)
|
||||
}
|
||||
}
|
||||
if len(out) == 0 {
|
||||
return ""
|
||||
|
Loading…
Reference in New Issue
Block a user