27 lines
609 B
PHP
27 lines
609 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Exception;
|
|
|
|
use Symfony\Component\HttpKernel\Exception\HttpException;
|
|
|
|
/**
|
|
* Exception thrown when attempting to load hotel data that does not exist.
|
|
*
|
|
* This exception is used when a hotel ID cannot be found in the
|
|
* available hotel data sources.
|
|
*/
|
|
class HotelNotFoundException extends HttpException
|
|
{
|
|
public function __construct(int $hotelId, ?\Throwable $previous = null)
|
|
{
|
|
$message = sprintf(
|
|
'Hotel not found for hotel ID %d',
|
|
$hotelId
|
|
);
|
|
|
|
parent::__construct(404, $message, $previous);
|
|
}
|
|
}
|