Skip to content

Commit b0ee9f3

Browse files
committed
fix(error_status_code): InvalidUriVariableException status code (e400)
1 parent 613bb5b commit b0ee9f3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Symfony/EventListener/ErrorListener.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
use ApiPlatform\Metadata\Error as ErrorOperation;
1717
use ApiPlatform\Metadata\Exception\HttpExceptionInterface;
18+
use ApiPlatform\Metadata\Exception\InvalidUriVariableException;
1819
use ApiPlatform\Metadata\Exception\ProblemExceptionInterface;
1920
use ApiPlatform\Metadata\HttpOperation;
2021
use ApiPlatform\Metadata\IdentifiersExtractorInterface;
@@ -178,7 +179,7 @@ private function getStatusCode(?HttpOperation $apiOperation, Request $request, ?
178179
return $exception->getStatusCode();
179180
}
180181

181-
if ($exception instanceof RequestExceptionInterface) {
182+
if ($exception instanceof RequestExceptionInterface || $exception instanceof InvalidUriVariableException) {
182183
return 400;
183184
}
184185

0 commit comments

Comments
 (0)