From 816f3da4d3c04cdf6c277e9083238b1377a46c74 Mon Sep 17 00:00:00 2001 From: Rasmus Dahlberg Date: Sun, 2 Apr 2023 21:21:04 +0200 Subject: Annotate (non-)deadline more clearly Made sense to then split conn errors as well. --- main.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'main.go') diff --git a/main.go b/main.go index 5972132..a372fa1 100644 --- a/main.go +++ b/main.go @@ -109,6 +109,10 @@ func work(ctx context.Context, cli *http.Client, timeout time.Duration, question req, err := http.NewRequestWithContext(cctx, http.MethodGet, "https://"+question.Domain, nil) if err != nil { answer.ReqErr = err + if cctx.Err() != nil { + answer.CtxErr = true + } + answerCh <- answer return } @@ -116,6 +120,10 @@ func work(ctx context.Context, cli *http.Client, timeout time.Duration, question rsp, err := cli.Do(req) if err != nil { answer.DoErr = err + if cctx.Err() != nil { + answer.CtxErr = true + } + answerCh <- answer return } -- cgit v1.2.3