From 086f78a08b23d6c7f67793e659dce5438a005f7e Mon Sep 17 00:00:00 2001 From: Jesse de Wit Date: Mon, 13 Nov 2023 21:46:07 +0100 Subject: [PATCH] log notification error responses --- notifications/notification_service.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/notifications/notification_service.go b/notifications/notification_service.go index 7429d03..8dd50cc 100644 --- a/notifications/notification_service.go +++ b/notifications/notification_service.go @@ -4,6 +4,7 @@ import ( "bytes" "context" "encoding/json" + "io" "log" "net/http" "sync" @@ -123,7 +124,10 @@ func (s *NotificationService) notifyOnce(ctx context.Context, req *PaymentReceiv } if resp.StatusCode != 200 { - log.Printf("Got non 200 status code (%s) for payment notification for %s to %s: %v", resp.Status, pubkey, url, err) + buf := make([]byte, 1000) + bytesRead, _ := io.ReadFull(resp.Body, buf) + respBody := buf[:bytesRead] + log.Printf("Got non 200 status code (%s) for payment notification for %s to %s: %s", resp.Status, pubkey, url, respBody) // TODO: Remove subscription? return false }