replace BadRequestException by BadRequestHttpException

This commit is contained in:
2022-04-27 14:30:50 +02:00
parent f14c915502
commit 48daed26f9
9 changed files with 25 additions and 27 deletions

View File

@@ -33,10 +33,10 @@ use DateInterval;
use DateTimeImmutable;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpFoundation\Exception\BadRequestException;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\Serializer\Exception\RuntimeException;
@@ -185,7 +185,7 @@ final class AccompanyingCourseApiController extends ApiController
->deserialize($request->getContent(), Person::class, $_format, []);
if (null === $person) {
throw new BadRequestException('person id not found');
throw new BadRequestHttpException('person id not found');
}
// TODO add acl
@@ -204,7 +204,7 @@ final class AccompanyingCourseApiController extends ApiController
break;
default:
throw new BadRequestException('This method is not supported');
throw new BadRequestHttpException('This method is not supported');
}
$errors = $this->validator->validate($accompanyingPeriod);
@@ -247,12 +247,12 @@ final class AccompanyingCourseApiController extends ApiController
}
if (null === $requestor) {
throw new BadRequestException('Could not find any person or thirdparty', 0, null);
throw new BadRequestHttpException('Could not find any person or thirdparty', 0, null);
}
$accompanyingPeriod->setRequestor($requestor);
} else {
throw new BadRequestException('method not supported');
throw new BadRequestHttpException('method not supported');
}
$errors = $this->validator->validate($accompanyingPeriod);