Better logging for connection failures.
This commit is contained in:
parent
cafabc99f6
commit
0be787db78
|
@ -147,7 +147,7 @@ func (c *DeviceClient) getAttribute(attr string) (string, error) {
|
||||||
func (c *DeviceClient) dialDevice() (*wire.Conn, error) {
|
func (c *DeviceClient) dialDevice() (*wire.Conn, error) {
|
||||||
conn, err := c.dialer.Dial()
|
conn, err := c.dialer.Dial()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("error dialing adb server: %+v", err)
|
return nil, fmt.Errorf("error dialing adb server (%s): %+v", c.dialer, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
req := fmt.Sprintf("host:%s", c.descriptor.getTransportDescriptor())
|
req := fmt.Sprintf("host:%s", c.descriptor.getTransportDescriptor())
|
||||||
|
|
|
@ -23,6 +23,10 @@ func NewDialer(host string, port int) Dialer {
|
||||||
return &netDialer{host, port}
|
return &netDialer{host, port}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (d *netDialer) String() string {
|
||||||
|
return fmt.Sprintf("netDialer(%s:%d)", d.Host, d.Port)
|
||||||
|
}
|
||||||
|
|
||||||
// Dial connects to the adb server on the host and port set on the netDialer.
|
// Dial connects to the adb server on the host and port set on the netDialer.
|
||||||
// The zero-value will connect to the default, localhost:5037.
|
// The zero-value will connect to the default, localhost:5037.
|
||||||
func (d *netDialer) Dial() (*Conn, error) {
|
func (d *netDialer) Dial() (*Conn, error) {
|
||||||
|
|
Loading…
Reference in a new issue