Skip to content

[Cache] No exception is thrown when caching closure #43895

@k0nst1

Description

@k0nst1

Symfony version(s) affected

4.4

Description

When using the a Cache Pool (happens with CacheItemPoolInterface and CacheInterface) and trying to cache something with the that contains a closure, the marshaller tries to serialize it and runs into an exception. The exception is never handled or logged.

How to reproduce

Store something that contains a closure into the cache. In my case it was a getInfo() on a ResponseInterface.

Possible Solution

Handle the exception or pass it down to the adapter so it can be seen.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions