fix: log unsuccessful webhook response body as a string (#16439)

This commit is contained in:
Aaron Lehmann
2025-02-05 03:22:20 -08:00
committed by GitHub
parent 182bb9bdda
commit c8ef7eb4f2

View File

@ -106,7 +106,7 @@ func (w *WebhookHandler) dispatch(msgPayload types.MessagePayload, titlePlaintex
return true, xerrors.Errorf("non-2xx response (%d), read body: %w", resp.StatusCode, err)
}
w.log.Warn(ctx, "unsuccessful delivery", slog.F("status_code", resp.StatusCode),
slog.F("response", respBody[:n]), slog.F("msg_id", msgID))
slog.F("response", string(respBody[:n])), slog.F("msg_id", msgID))
return true, xerrors.Errorf("non-2xx response (%d)", resp.StatusCode)
}