core
core copied to clipboard
Exceptions occurred during denormalization are incorrectly wrapped
API Platform version(s) affected: >=4.2.0
Description
When DataUriNormalizer throws an exception with the message 'The provided "data:" URI is not valid.', it is caught by this if statement (added in #7104), and the exception is incorrectly wrapped.
How to reproduce
- Implement file uploading using this procedure.
- Remove
UploadedFileDenormalizer. - Actually perform the file upload.
DataUriNormalizerthrows the relevant exception, but it is wrapped in the exception"The type of the \"file\" attribute must be \"Symfony\\Component\\HttpFoundation\\File\\File|null\", \"object\" given."