return the cancellation cause for cancelled dials (#4078)

This commit is contained in:
Marten Seemann
2023-09-16 19:37:58 +07:00
committed by GitHub
parent 1affe38703
commit 55eebd49ff
2 changed files with 21 additions and 1 deletions

View File

@@ -233,7 +233,7 @@ func (c *client) dial(ctx context.Context) error {
select {
case <-ctx.Done():
c.conn.shutdown()
return ctx.Err()
return context.Cause(ctx)
case err := <-errorChan:
return err
case recreateErr := <-recreateChan: