Skip to content

Commit f32848e

Browse files
committed
improve error message
1 parent 65abcfa commit f32848e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

codersdk/workspaceagents.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -430,15 +430,15 @@ func (c *Client) DialWorkspaceAgent(dialCtx context.Context, agentID uuid.UUID,
430430
for firstCoordinator != nil || firstDerpMap != nil {
431431
select {
432432
case <-dialCtx.Done():
433-
return nil, dialCtx.Err()
433+
return nil, xerrors.Errorf("timed out waiting for coordinator and derp map: %w", dialCtx.Err())
434434
case err = <-firstCoordinator:
435435
if err != nil {
436-
return nil, err
436+
return nil, xerrors.Errorf("start coordinator: %w", err)
437437
}
438438
firstCoordinator = nil
439439
case err = <-firstDerpMap:
440440
if err != nil {
441-
return nil, err
441+
return nil, xerrors.Errorf("receive derp map: %w", err)
442442
}
443443
firstDerpMap = nil
444444
}
@@ -461,7 +461,7 @@ func (c *Client) DialWorkspaceAgent(dialCtx context.Context, agentID uuid.UUID,
461461

462462
if !agentConn.AwaitReachable(dialCtx) {
463463
_ = agentConn.Close()
464-
return nil, xerrors.Errorf("timed out waiting for agent to become reachable: %w", ctx.Err())
464+
return nil, xerrors.Errorf("timed out waiting for agent to become reachable: %w", dialCtx.Err())
465465
}
466466

467467
return agentConn, nil

0 commit comments

Comments
 (0)