Skip to content

Commit 1d88f04

Browse files
committed
fix(forward): debug-log failed device connect and return the real error
"could not connect to phone" fires once per client connection when the device port is unreachable; downgrade it to debug to match the other per-connection lifecycle logs. Also return muxError instead of the nil err in the wrapped error, which previously dropped the actual reason.
1 parent 3866fff commit 1d88f04

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ios/forward/forward.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ func StartNewProxyConnection(ctx context.Context, clientConn io.ReadWriteCloser,
9494
}
9595
muxError := usbmuxConn.Connect(deviceID, phonePort)
9696
if muxError != nil {
97-
golog.Info("could not connect to phone", "module", logModule, "deviceID", deviceID, "conn", fmt.Sprintf("%#v", clientConn), "error", muxError, "phonePort", phonePort)
97+
golog.Debug("could not connect to phone", "module", logModule, "deviceID", deviceID, "conn", fmt.Sprintf("%#v", clientConn), "error", muxError, "phonePort", phonePort)
9898
clientConn.Close()
99-
return fmt.Errorf("could not connect to port:%d on iOS: %v", phonePort, err)
99+
return fmt.Errorf("could not connect to port:%d on iOS: %v", phonePort, muxError)
100100
}
101101
golog.Debug("connected to port", "module", logModule, "deviceID", deviceID, "conn", fmt.Sprintf("%#v", clientConn), "phonePort", phonePort)
102102
deviceConn := usbmuxConn.ReleaseDeviceConnection()

0 commit comments

Comments
 (0)