all repos — honk @ ec6d70619f491d2dc91915d27f0b0ff29feffe5d

my fork of honk

read post body for failures
Ted Unangst tedu@tedunangst.com
Sun, 24 Dec 2023 13:38:04 -0500
commit

ec6d70619f491d2dc91915d27f0b0ff29feffe5d

parent

0f87c9ba9f9b9301059e9fada4675bf9c0339ee7

1 files changed, 4 insertions(+), 1 deletions(-)

jump to
M activity.goactivity.go

@@ -93,12 +93,15 @@ resp, err := honkClient.Do(req)

if err != nil { return err } - resp.Body.Close() + defer resp.Body.Close() switch resp.StatusCode { case 200: case 201: case 202: default: + var buf [4096]byte + n, _ := resp.Body.Read(buf[:]) + dlog.Printf("post failure message: %s", buf[n:]) return fmt.Errorf("http post status: %d", resp.StatusCode) } ilog.Printf("successful post: %s %d", url, resp.StatusCode)