Skip to content

Commit

Permalink
RHINENG-14351: fix candlepin API status handling
Browse files Browse the repository at this point in the history
fixes
2024/12/13 12:34:43 [Recovery] 2024/12/13 - 12:34:43 panic recovered:
runtime error: invalid memory address or nil pointer dereference
/go/pkg/mod/github.com/gin-contrib/[email protected]/timeout.go:63 (0x1182204)
/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:185 (0xbdacca)
  • Loading branch information
MichaelMraka committed Dec 13, 2024
1 parent bed812e commit eff9fca
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion manager/controllers/template_systems_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,10 @@ func callCandlepin(ctx context.Context, consumer string, request *candlepin.Cons
statusCode := utils.TryGetStatusCode(resp)
utils.LogDebug("request", *request, "candlepin_url", candlepinEnvConsumersURL,
"status_code", statusCode, "err", err)
if err != nil || statusCode != http.StatusOK {
if err != nil {
err = errors.Wrap(errCandlepin, err.Error())
} else if statusCode != http.StatusOK && statusCode != http.StatusNoContent {
err = errors.Errorf("candlepin API status %d", statusCode)
}
return &candlepinResp, resp, err
}
Expand Down

0 comments on commit eff9fca

Please sign in to comment.