Files
myep/src/Exception/BookingNotPossibleException.php
T

25 lines
638 B
PHP

<?php
declare(strict_types=1);
namespace App\Exception;
use Symfony\Component\HttpKernel\Exception\HttpException;
/**
* Exception thrown when attempting to create a booking for a travel with Buchungsstop status.
*/
class BookingNotPossibleException extends HttpException
{
public function __construct(int $dateId, int $hotelId, ?\Throwable $previous = null)
{
$message = sprintf(
'Für diese Reise ist aktuell keine Buchung möglich (Travel ID: %d, Hotel ID: %d). Status: Buchungsstop',
$dateId,
$hotelId
);
parent::__construct(400, $message, $previous);
}
}