sampler-fork/data/error.go

16 lines
223 B
Go
Raw Normal View History

2019-03-17 03:13:14 +00:00
package data
import (
"fmt"
"os/exec"
)
func getErrorMessage(err *exec.ExitError) string {
stderr := string(err.Stderr)
if len(stderr) == 0 {
return err.Error()
} else {
return fmt.Sprintf("%.200s", stderr)
}
}