Skip to content

Commit

Permalink
zedcloud: print http response content if error
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Ostarek <christoph@zededa.com>
  • Loading branch information
christoph-zededa committed Jan 23, 2023
1 parent bcde325 commit 03beb2f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/pillar/zedcloud/send.go
Original file line number Diff line number Diff line change
Expand Up @@ -786,9 +786,9 @@ func SendOnIntf(workContext context.Context, ctx *ZedCloudContext, destURL strin
log.Tracef("SendOnIntf to %s, response %s\n", reqUrl, resp.Status)
return resp, contents, senderStatus, nil
default:
errStr := fmt.Sprintf("SendOnIntf to %s reqlen %d statuscode %d %s",
errStr := fmt.Sprintf("SendOnIntf to %s reqlen %d statuscode %d %s body: %s",
reqUrl, reqlen, resp.StatusCode,
http.StatusText(resp.StatusCode))
http.StatusText(resp.StatusCode), utils.HexStrings(contents, 256))
// zedrouter probing sends 'http' to zedcloud server, expect to get status of 404, not an error
if resp.StatusCode != http.StatusNotFound || ctx.AgentName != "zedrouter" {
log.Errorln(errStr)
Expand Down

0 comments on commit 03beb2f

Please sign in to comment.