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 26, 2023
1 parent dab5bbd commit 4517440
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 @@ -939,9 +939,9 @@ func SendOnIntf(workContext context.Context, ctx *ZedCloudContext, destURL strin
rv.RespContents = contents
return rv, 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 4517440

Please sign in to comment.