Skip to content

Commit

Permalink
minor #52992 [Serializer] Make sure Serializer::denormalize() shows w…
Browse files Browse the repository at this point in the history
…hat exception it throws (Nyholm)

This PR was merged into the 5.4 branch.

Discussion
----------

[Serializer] Make sure Serializer::denormalize() shows what exception it throws

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Issues        | no
| License       | MIT

This was missing from #42502. We have no contract that explains that this exceptions should be thrown.

With this addition, we technically make this a "sometimes" feature of the Serializer class.

Commits
-------

bca846b Make sure Serializer::denormalize have show what exception it throws
  • Loading branch information
fabpot committed Dec 13, 2023
2 parents 092f374 + bca846b commit 1ae24df
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Symfony/Component/Serializer/Serializer.php
Expand Up @@ -197,6 +197,7 @@ public function normalize($data, string $format = null, array $context = [])
* {@inheritdoc}
*
* @throws NotNormalizableValueException
* @throws PartialDenormalizationException Occurs when one or more properties of $type fails to denormalize
*/
public function denormalize($data, string $type, string $format = null, array $context = [])
{
Expand Down

0 comments on commit 1ae24df

Please sign in to comment.