From 1ceb74e461b0c01ce96eaca4b122283dcf036757c19698f6f67c597281be3d11 Mon Sep 17 00:00:00 2001 From: Adam Majer Date: Tue, 27 Aug 2024 10:58:56 +0200 Subject: [PATCH] . --- gitea-events-rabbitmq-publisher/main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gitea-events-rabbitmq-publisher/main.go b/gitea-events-rabbitmq-publisher/main.go index 2ff6f6e..e0f1217 100644 --- a/gitea-events-rabbitmq-publisher/main.go +++ b/gitea-events-rabbitmq-publisher/main.go @@ -36,7 +36,10 @@ var id int func dumpUnhandledData(reqType string, data []byte) { id++ - os.WriteFile("/tmp/unhandled-json-"+reqType+"-"+fmt.Sprint(id)+".json", data, 0600) + if err := os.WriteFile(fmt.Sprintf("/tmp/unhandled-json-%s-%d.json", reqType,id), data, 0600); err != nil { + log.Printf("Cannot dump json. err: %v\n", err) + log.Println(string(data)) + } } func parseRequestJSON(reqType string, data []byte) (org *common.Organization, extraAction string, err error) {