Files
points-of-interest/server/src/Exception/PointTooFarException.php
T
2025-10-10 14:55:36 +02:00

19 lines
543 B
PHP

<?php
declare(strict_types=1);
namespace App\Exception;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Attribute\WithHttpStatus;
use function sprintf;
#[WithHttpStatus(Response::HTTP_UNPROCESSABLE_ENTITY, headers: ['x-error-code' => 'point_too_far'])]
final class PointTooFarException extends \RuntimeException
{
public function __construct(float $maximumDistanceKm)
{
parent::__construct(sprintf('The submitted point must be within %.2fkm of your location.', $maximumDistanceKm));
}
}