Skip to content

Commit 0f91a71

Browse files
authored
Merge pull request #3132 from Taminoful/2.5
Update thrown exception and clarify error message for UuidNormalizer.
2 parents c5af156 + 5368930 commit 0f91a71

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/EventListener/ReadListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function onKernelRequest(GetResponseEvent $event): void
109109
$data = $this->getSubresourceData($identifiers, $attributes, $context);
110110
}
111111
} catch (InvalidIdentifierException $e) {
112-
throw new NotFoundHttpException('Not found, because of an invalid identifier configuration', $e);
112+
throw new NotFoundHttpException('Invalid identifier value or configuration.', $e);
113113
}
114114

115115
if (null === $data) {

tests/Bridge/RamseyUuid/Normalizer/UuidNormalizerTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
namespace ApiPlatform\Core\Tests\Bridge\RamseyUuid\Normalizer;
1515

1616
use ApiPlatform\Core\Bridge\RamseyUuid\Identifier\Normalizer\UuidNormalizer;
17+
use ApiPlatform\Core\Exception\InvalidIdentifierException;
1718
use PHPUnit\Framework\TestCase;
1819
use Ramsey\Uuid\Uuid;
1920

@@ -36,7 +37,7 @@ public function testNoSupportDenormalizeUuid()
3637

3738
public function testFailDenormalizeUuid()
3839
{
39-
$this->expectException(\ApiPlatform\Core\Exception\InvalidIdentifierException::class);
40+
$this->expectException(InvalidIdentifierException::class);
4041

4142
$uuid = 'notanuuid';
4243
$normalizer = new UuidNormalizer();

0 commit comments

Comments
 (0)