Add cause for all context timeouts (#2862)

This commit is contained in:
Sanket Sudake
2023-10-29 13:19:06 +05:30
committed by GitHub
parent 2223081c80
commit 267f7faf18
6 changed files with 17 additions and 14 deletions
+1 -1
View File
@@ -131,7 +131,7 @@ func (opts *TestSubCommand) do(input cli.Input) error {
ctx = input.Context()
} else {
var closeCtx context.CancelFunc
ctx, closeCtx = context.WithTimeout(input.Context(), reqTimeout*time.Second)
ctx, closeCtx = context.WithTimeoutCause(input.Context(), reqTimeout*time.Second, fmt.Errorf("function request timeout (%d)s exceeded", reqTimeout))
defer closeCtx()
}