mirror of
https://github.com/taigrr/adb.git
synced 2026-04-02 02:58:42 -07:00
fix: replace panic with error return in execute(), fix Pull/Push/Reboot/Root targeting
- execute() no longer panics when adb is not found; returns ErrNotInstalled - Use sync.Once for lazy adb path lookup instead of init() - Fix Pull() checking src (device path) instead of dest (local path) - Add ErrDestExists error for Pull destination conflicts - Add -s serial flag to Push, Pull, Reboot, Root for multi-device support - Root() now parses stdout to determine actual success - Fix Shell() redundant variable redeclaration - Fix 'inconsostency' typo in KillServer doc - Add doc comments to all error variables - Update Go 1.26.0 -> 1.26.1 - Add tests: ConnString, ShortenSleep, GetLength, JSON roundtrip, SequenceImporter.ToInput, insertSleeps, parseDevices edge cases, parseScreenResolution edge cases, filterErr
This commit is contained in:
18
errors.go
18
errors.go
@@ -5,12 +5,18 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
// When an execution should have data but has none, but the exact error is
|
||||
// indeterminite, this error is returned
|
||||
ErrStdoutEmpty = errors.New("stdout expected to contain data but was empty")
|
||||
ErrNotInstalled = errors.New("adb is not installed or not in PATH")
|
||||
// ErrStdoutEmpty is returned when an execution should have data but has none.
|
||||
ErrStdoutEmpty = errors.New("stdout expected to contain data but was empty")
|
||||
// ErrNotInstalled is returned when adb cannot be found in PATH.
|
||||
ErrNotInstalled = errors.New("adb is not installed or not in PATH")
|
||||
// ErrCoordinatesNotFound is returned when touch event coordinates are missing.
|
||||
ErrCoordinatesNotFound = errors.New("coordinates for an input event are missing")
|
||||
ErrConnUSB = errors.New("cannot call connect/disconnect to device using USB")
|
||||
// ErrConnUSB is returned when connect/disconnect is called on a USB device.
|
||||
ErrConnUSB = errors.New("cannot call connect/disconnect to device using USB")
|
||||
// ErrResolutionParseFail is returned when screen resolution output cannot be parsed.
|
||||
ErrResolutionParseFail = errors.New("failed to parse screen size from input text")
|
||||
ErrUnspecified = errors.New("an unknown error has occurred, please open an issue on GitHub")
|
||||
// ErrDestExists is returned when a pull destination file already exists.
|
||||
ErrDestExists = errors.New("destination file already exists")
|
||||
// ErrUnspecified is returned when the exact error cannot be determined.
|
||||
ErrUnspecified = errors.New("an unknown error has occurred, please open an issue on GitHub")
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user