feat: improved timeout handling for api client

This commit is contained in:
Björn Fromme
2026-03-16 11:59:11 +01:00
parent be90248fc7
commit 37924841e1
14 changed files with 139 additions and 14 deletions
@@ -5,6 +5,7 @@ declare(strict_types=1);
namespace App\Controller\Booking\Create;
use App\BusProNet\ApiClient;
use App\BusProNet\Exception\TimeoutException;
use App\BusProNet\Model\Notification;
use App\Controller\Booking\Traits\BookingCreateTrait;
use App\Controller\Booking\Traits\BookingExceptionHandlerTrait;
@@ -94,6 +95,17 @@ class Step4Controller extends AbstractController
$this->bookingService->clearBookingCreateDto($request);
return $this->hxRedirect($request, $this->generateUrl('app_booking_create_success'));
} catch (TimeoutException $e) {
return $this->handleApiError(
'Booking creation timeout',
[
'exception' => $e->getMessage(),
'trace' => $e->getTraceAsString(),
],
'Die Anfrage hat zu lange gedauert. Bitte versuchen Sie es erneut.',
$bookingCreateDto,
$form
);
} catch (\Exception $e) {
return $this->handleApiError(
'Booking creation exception',