Skip to content

Exceptions occurred during denormalization are incorrectly wrapped #7490

@ttskch

Description

@ttskch

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."

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions