Skip to content

Commit dc77265

Browse files
committed
change exception
1 parent 746e885 commit dc77265

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

api/src/Api/Processor/ArchiveProcessor.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
use App\Entity\Archive;
99
use ApiPlatform\Metadata\Operation;
1010
use App\Archive\IdentifierGenerator;
11+
use App\Consumer\Handler\BuildArchive;
1112
use Doctrine\ORM\EntityManagerInterface;
1213
use ApiPlatform\State\ProcessorInterface;
1314
use Symfony\Bundle\SecurityBundle\Security;
1415
use ApiPlatform\Validator\ValidatorInterface;
15-
use ApiPlatform\Serializer\AbstractItemNormalizer;
16-
use App\Consumer\Handler\BuildArchive;
1716
use Symfony\Component\Messenger\MessageBusInterface;
17+
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
1818
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
1919

2020
class ArchiveProcessor implements ProcessorInterface
@@ -63,7 +63,7 @@ public function process(mixed $data, Operation $operation, array $uriVariables =
6363
} else {
6464
$object = $this->em->find(Archive::class, $uriVariables['id']);
6565
if (null === $object) {
66-
throw new BadRequestHttpException('Archive not found');
66+
throw new NotFoundHttpException('Archive not found');
6767
}
6868
}
6969

0 commit comments

Comments
 (0)