Skip to content

Commit ccc096b

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

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

codersdk/workspaceagents.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ 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 {
436436
return nil, err
@@ -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)