fix: return proper response for stale participant edit urls

This commit is contained in:
Björn Fromme
2026-04-11 18:28:32 +02:00
parent 63e8a068b3
commit 95d50e9833
3 changed files with 26 additions and 2 deletions
@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace App\Service;
use App\Exception\ParticipantNotFoundException;
use App\Form\Model\BookingDto;
use App\Form\Model\ParticipantDto;
use App\Form\Model\ParticipantEditDto;
@@ -24,7 +25,7 @@ class ParticipantFormSupportService
$participant = $bookingDto->participants[$index] ?? null;
if (null === $participant) {
throw new \InvalidArgumentException(sprintf('Participant at index %d does not exist', $index));
throw new ParticipantNotFoundException($index);
}
return $participant;