aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus@rgdd.se>2023-04-02 21:21:04 +0200
committerRasmus Dahlberg <rasmus@rgdd.se>2023-04-02 22:06:32 +0200
commit816f3da4d3c04cdf6c277e9083238b1377a46c74 (patch)
tree7e8cf77ac385e957a8a49783631604e83d9de44d /main.go
parentad0981749ab82e1401e30a20e8973ce32d30dcf0 (diff)
Annotate (non-)deadline more clearly
Made sense to then split conn errors as well.
Diffstat (limited to 'main.go')
-rw-r--r--main.go8
1 files changed, 8 insertions, 0 deletions
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
}