Skip to content

Commit

Permalink
bug #49186 [Serializer] Improve exception message in UnwrappingDenorm…
Browse files Browse the repository at this point in the history
…alizer (andersonamuller)

This PR was submitted for the 7.1 branch but it was squashed and merged into the 6.4 branch instead.

Discussion
----------

[Serializer] Improve exception message in UnwrappingDenormalizer

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

The current code expects the path to be replaced in the message, but probably it was forgotten.

Commits
-------

3c96bfb [Serializer] Improve exception message in UnwrappingDenormalizer
  • Loading branch information
fabpot committed May 17, 2024
2 parents b49df79 + 3c96bfb commit e4bd593
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function withUnwrapPath(?string $unwrapPath): static
try {
new PropertyPath($unwrapPath);
} catch (InvalidPropertyPathException $e) {
throw new InvalidArgumentException('The "%s" property path is not valid.', previous: $e);
throw new InvalidArgumentException(sprintf('The "%s" property path is not valid.', $unwrapPath), previous: $e);
}

return $this->with(UnwrappingDenormalizer::UNWRAP_PATH, $unwrapPath);
Expand Down

0 comments on commit e4bd593

Please sign in to comment.