core icon indicating copy to clipboard operation
core copied to clipboard

Exceptions occurred during denormalization are incorrectly wrapped

Open ttskch opened this issue 2 months ago • 0 comments

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

  1. Implement file uploading using this procedure.
  2. Remove UploadedFileDenormalizer.
  3. Actually perform the file upload.
  4. DataUriNormalizer throws 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."

ttskch avatar Oct 29 '25 07:10 ttskch