From 7017e2e17880c6d79558127454799480d5bd75f0 Mon Sep 17 00:00:00 2001 From: Toon Verwerft Date: Tue, 9 Jan 2024 13:00:39 +0100 Subject: [PATCH] Provide better trace info --- src/Domain/Query/FetchMessage.php | 2 +- .../Presentation/Controller/Admin/RequeueControllerTest.php | 2 +- .../Unit/Presentation/Controller/Admin/RetryControllerTest.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Domain/Query/FetchMessage.php b/src/Domain/Query/FetchMessage.php index f8f91f6..17dc6a8 100644 --- a/src/Domain/Query/FetchMessage.php +++ b/src/Domain/Query/FetchMessage.php @@ -53,7 +53,7 @@ public function __invoke(int $messageId, bool $withDetails): FailedMessage ->withMessageDetails($this->serializer->serialize($message->getMessage(), 'json')) ->withMessageBusName($message->last(BusNameStamp::class)?->getBusName()) ->withMessageOriginalTransport($message->last(SentToFailureTransportStamp::class)?->getOriginalReceiverName()) - ->withErrorTrace($lastErrorStamp?->getFlattenException()?->getTraceAsString()) + ->withErrorTrace($lastErrorStamp?->getFlattenException()?->getAsString()) ->withFailedDates(...array_map( fn (RedeliveryStamp $stamp): \DateTimeInterface => $stamp->getRedeliveredAt(), $message->all(RedeliveryStamp::class) diff --git a/tests/Unit/Presentation/Controller/Admin/RequeueControllerTest.php b/tests/Unit/Presentation/Controller/Admin/RequeueControllerTest.php index 3f90605..c8c707f 100644 --- a/tests/Unit/Presentation/Controller/Admin/RequeueControllerTest.php +++ b/tests/Unit/Presentation/Controller/Admin/RequeueControllerTest.php @@ -55,7 +55,7 @@ public function it_will_respond_with_bad_request_when_requeue_failed(): void 'identifiers' => [1, 2], ])); - $this->handler->__invoke(1)->willThrow(new \RuntimeException('Something failed')); + $this->handler->__invoke(1)->willThrow(new RuntimeException('Something failed')); $response = ($this->controller)($request); diff --git a/tests/Unit/Presentation/Controller/Admin/RetryControllerTest.php b/tests/Unit/Presentation/Controller/Admin/RetryControllerTest.php index 616676c..9ecffc0 100644 --- a/tests/Unit/Presentation/Controller/Admin/RetryControllerTest.php +++ b/tests/Unit/Presentation/Controller/Admin/RetryControllerTest.php @@ -55,7 +55,7 @@ public function it_will_respond_with_bad_request_when_retry_failed(): void 'identifiers' => [1, 2], ])); - $this->handler->__invoke(1)->willThrow(new \RuntimeException('Something failed')); + $this->handler->__invoke(1)->willThrow(new RuntimeException('Something failed')); $response = ($this->controller)($request);