Merge pull request #9 from zach-klippenstein/start-server-errs
Added command output to StartServer error.
This commit is contained in:
commit
11dc26d9ba
|
@ -2,6 +2,7 @@ package goadb
|
|||
|
||||
import (
|
||||
"os/exec"
|
||||
"strings"
|
||||
|
||||
"github.com/zach-klippenstein/goadb/util"
|
||||
)
|
||||
|
@ -11,6 +12,7 @@ StartServer ensures there is a server running.
|
|||
*/
|
||||
func StartServer() error {
|
||||
cmd := exec.Command("adb", "start-server")
|
||||
err := cmd.Run()
|
||||
return util.WrapErrorf(err, util.ServerNotAvailable, "error starting server: %s", err)
|
||||
output, err := cmd.CombinedOutput()
|
||||
outputStr := strings.TrimSpace(string(output))
|
||||
return util.WrapErrorf(err, util.ServerNotAvailable, "error starting server: %s\noutput:\n%s", err, outputStr)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue