We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5a5e097 commit 2458d5eCopy full SHA for 2458d5e
pkg/notification/notice.go
@@ -81,8 +81,13 @@ func (v *VersionChecker) RunUpdateCheck(ctx context.Context) {
81
82
req.Header.Set("User-Agent", fmt.Sprintf("trivy/%s", v.currentVersion))
83
resp, err := client.Do(req)
84
- if err != nil || resp.StatusCode != http.StatusOK {
85
- logger.Debug("Failed getting response from Trivy api", log.Err(err))
+ if err != nil {
+ if !errors.Is(err, context.Canceled) && !errors.Is(err, context.DeadlineExceeded) {
86
+ logger.Debug("Failed getting response from Trivy api", log.Err(err))
87
+ }
88
+ return
89
+ } else if resp.StatusCode != http.StatusOK {
90
+ logger.Debug("Unexpected status code from Trivy api", log.Int("status_code", resp.StatusCode))
91
return
92
}
93
0 commit comments