-
Notifications
You must be signed in to change notification settings - Fork 6
fix(pkg/board): handle adb connection error #98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(pkg/board): handle adb connection error #98
Conversation
| } | ||
| if err := cmd.Run(); err != nil { | ||
| return nil, fmt.Errorf("failed to connect to ADB host %s: %w", host, err) | ||
| if out, err := cmd.RunAndCaptureCombinedOutput(context.TODO()); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not context.Background()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's exactly the same, but TODO, remember to add it in the future.
dido18
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only for reference, the other possible states of the get-state are the following:
adb get-state print offline | bootloader | device
Motivation
We should check if the board is connected before returning an ADBConnetion object.
Change description
Use
adb get-statefor checking if the board is there and it is connected.Additional Notes
Reviewer checklist
main.