mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 23:51:25 +08:00
refactor: raise adb error
This commit is contained in:
@@ -5,7 +5,10 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/rs/zerolog/log"
|
||||
|
||||
"github.com/httprunner/httprunner/v4/hrp/internal/code"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -84,6 +87,12 @@ func (c Client) DeviceSerialList() (serials []string, err error) {
|
||||
}
|
||||
|
||||
func (c Client) DeviceList() (devices []*Device, err error) {
|
||||
defer func() {
|
||||
if err != nil && errors.Cause(err) == nil {
|
||||
err = errors.Wrap(code.AndroidDeviceConnectionError, err.Error())
|
||||
}
|
||||
}()
|
||||
|
||||
var resp string
|
||||
if resp, err = c.executeCommand("host:devices-l"); err != nil {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user