@@ -194,7 +194,7 @@ func vsockConnectMsg(port uint32) string {
194
194
func tryConnect (logger * logrus.Entry , udsPath string , port uint32 ) (net.Conn , error ) {
195
195
conn , err := net .DialTimeout ("unix" , udsPath , unixDialTimeout )
196
196
if err != nil {
197
- return nil , err
197
+ return nil , errors . Wrapf ( err , "failed to dial %q within %s" , udsPath , unixDialTimeout )
198
198
}
199
199
200
200
defer func () {
@@ -207,14 +207,19 @@ func tryConnect(logger *logrus.Entry, udsPath string, port uint32) (net.Conn, er
207
207
}
208
208
}()
209
209
210
- err = tryConnWrite (conn , vsockConnectMsg (port ), vsockConnectMsgTimeout )
210
+ msg := vsockConnectMsg (port )
211
+ err = tryConnWrite (conn , msg , vsockConnectMsgTimeout )
211
212
if err != nil {
212
- return nil , vsockConnectMsgError {cause : err }
213
+ return nil , vsockConnectMsgError {
214
+ cause : errors .Wrapf (err , `failed to write %q within %s` , msg , vsockConnectMsgTimeout ),
215
+ }
213
216
}
214
217
215
218
line , err := tryConnReadUntil (conn , '\n' , vsockAckMsgTimeout )
216
219
if err != nil {
217
- return nil , vsockAckError {cause : err }
220
+ return nil , vsockAckError {
221
+ cause : errors .Wrapf (err , `failed to read "OK <port>" within %s` , vsockAckMsgTimeout ),
222
+ }
218
223
}
219
224
220
225
// The line would be "OK <assigned_hostside_port>\n", but we don't use the hostside port here.
0 commit comments