feat: improved timeout handling for api client
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user