Skip to content

Commit 8909336

Browse files
authored
Merge pull request #2544 from soyuka/fix-2514-bis
Respect the RouterInterface by using a ResourceNotFoundException
2 parents c391f2a + ef1d2ad commit 8909336

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Bridge/Symfony/Routing/Router.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use ApiPlatform\Core\Api\UrlGeneratorInterface;
1717
use Symfony\Component\HttpFoundation\Exception\RequestExceptionInterface;
1818
use Symfony\Component\HttpFoundation\Request;
19-
use Symfony\Component\Routing\Exception\RouteNotFoundException;
19+
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
2020
use Symfony\Component\Routing\RequestContext;
2121
use Symfony\Component\Routing\RouterInterface;
2222

@@ -77,7 +77,7 @@ public function match($pathInfo)
7777
try {
7878
$context = (new RequestContext())->fromRequest($request);
7979
} catch (RequestExceptionInterface $e) {
80-
throw new RouteNotFoundException('Invalid request context.');
80+
throw new ResourceNotFoundException('Invalid request context.');
8181
}
8282

8383
$context->setPathInfo($pathInfo);

0 commit comments

Comments
 (0)