From 1ab88b362650e6cd2cd4afee7ac93d185602a97e Mon Sep 17 00:00:00 2001 From: "Ronald A. Richardson" Date: Fri, 18 Oct 2024 05:01:50 +0800 Subject: [PATCH] add exception message to meta --- src/Listeners/SendResourceLifecycleWebhook.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Listeners/SendResourceLifecycleWebhook.php b/src/Listeners/SendResourceLifecycleWebhook.php index 9ee5863..fc3dfd0 100644 --- a/src/Listeners/SendResourceLifecycleWebhook.php +++ b/src/Listeners/SendResourceLifecycleWebhook.php @@ -119,7 +119,7 @@ public function handle($event) 'api_event_uuid' => $apiEvent->uuid, 'method' => $request->getMethod(), 'status_code' => $exception->getStatusCode(), - 'reason_phrase' => $response->getReasonPhrase() ?? $exception->getMessage(), + 'reason_phrase' => $response->getReasonPhrase(), 'duration' => $durationStart->diffInSeconds(now()), 'url' => $request->getUri(), 'attempt' => 1, @@ -127,7 +127,8 @@ public function handle($event) 'status' => 'failed', 'headers' => $request->getHeaders(), 'meta' => [ - 'exception' => get_class($exception), + 'exception' => get_class($exception), + 'exception_message' => $exception->getMessage(), ], 'sent_at' => $durationStart, ];