Skip to content

Commit 3911a71

Browse files
feature #43148 [Cache] Throw ValueError in debug mode when serialization fails (nicolas-grekas)
This PR was merged into the 5.4 branch. Discussion ---------- [Cache] Throw ValueError in debug mode when serialization fails | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | yes | Deprecations? | - | Tickets | Fix #41685 | License | MIT | Doc PR | - This feature allows spotting mistakes at the dev stage when trying to store unserializable objects (typically a closure) into a cache. This PR replaces #42241 with a simpler and more focused approach: here we fail via a simple `ValueError`, which won't get caught by any try/catch into the Cache component, and we fail only when serialization fails - not on any failures of cache pool methods. Commits ------- 0d3ede7725 [Cache] Throw ValueError in debug mode when serialization fails
2 parents 8a6e259 + 077ca1e commit 3911a71

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Resources/config/cache.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@
217217
->set('cache.default_marshaller', DefaultMarshaller::class)
218218
->args([
219219
null, // use igbinary_serialize() when available
220+
'%kernel.debug%',
220221
])
221222

222223
->set('cache.early_expiration_handler', EarlyExpirationHandler::class)

0 commit comments

Comments
 (0)