feat: improved error handling of xml parsers and loaders
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user