From ad0a1b9a240079f98da180b38e94a01a3a11af33 Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 29 Jun 2023 11:47:08 +0200 Subject: [PATCH] Add moar debug --- app/Services/Webhook/StandardWebhookSender.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Services/Webhook/StandardWebhookSender.php b/app/Services/Webhook/StandardWebhookSender.php index 9fbc430141..0d4bff7069 100644 --- a/app/Services/Webhook/StandardWebhookSender.php +++ b/app/Services/Webhook/StandardWebhookSender.php @@ -111,9 +111,11 @@ class StandardWebhookSender implements WebhookSenderInterface try { $res = $client->request('POST', $this->message->webhook->url, $options); } catch (RequestException | ConnectException $e) { + Log::error('The webhook could NOT be submitted but Firefly III caught the error below.'); Log::error($e->getMessage()); Log::error($e->getTraceAsString()); + $logs = sprintf("%s\n%s", $e->getMessage(), $e->getTraceAsString()); $this->message->errored = true; @@ -125,6 +127,9 @@ class StandardWebhookSender implements WebhookSenderInterface $attempt->status_code = 0; if (method_exists($e, 'hasResponse') && method_exists($e, 'getResponse')) { $attempt->status_code = $e->hasResponse() ? $e->getResponse()->getStatusCode() : 0; + Log::error(sprintf('The status code of the error response is: %d', $attempt->status_code)); + $body = (string)($e->hasResponse() ? $e->getResponse()->getBody() : ''); + Log::error(sprintf('The body of the error response is: %s', $body)); } $attempt->logs = $logs; $attempt->save();