Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f816628

Browse filesBrowse files
committed
[Serializer] Fix wrong InvalidArgumentException
1 parent 6b34c00 commit f816628
Copy full SHA for f816628

File tree

1 file changed

+3
-2
lines changed
Filter options

1 file changed

+3
-2
lines changed

‎src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Component\Serializer\Normalizer;
1313

14-
use Symfony\Component\PropertyAccess\Exception\InvalidArgumentException;
14+
use Symfony\Component\PropertyAccess\Exception\InvalidArgumentException as PropertyAccessInvalidArgumentException;
1515
use Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException;
1616
use Symfony\Component\PropertyAccess\Exception\UninitializedPropertyException;
1717
use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface;
@@ -20,6 +20,7 @@
2020
use Symfony\Component\Serializer\Encoder\JsonEncoder;
2121
use Symfony\Component\Serializer\Encoder\XmlEncoder;
2222
use Symfony\Component\Serializer\Exception\ExtraAttributesException;
23+
use Symfony\Component\Serializer\Exception\InvalidArgumentException;
2324
use Symfony\Component\Serializer\Exception\LogicException;
2425
use Symfony\Component\Serializer\Exception\MissingConstructorArgumentsException;
2526
use Symfony\Component\Serializer\Exception\NotNormalizableValueException;
@@ -409,7 +410,7 @@ public function denormalize($data, string $type, string $format = null, array $c
409410

410411
try {
411412
$this->setAttributeValue($object, $attribute, $value, $format, $attributeContext);
412-
} catch (InvalidArgumentException $e) {
413+
} catch (PropertyAccessInvalidArgumentException $e) {
413414
$exception = NotNormalizableValueException::createForUnexpectedDataType(
414415
sprintf('Failed to denormalize attribute "%s" value for class "%s": '.$e->getMessage(), $attribute, $type),
415416
$data,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.