Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Database cache backend catches Exception instead of PDOException, which makes it catch other errors and hide real problems.
Looking at the code most people may say it's not a problem because the only thing which is called is the database, but working on #1748022: Make cache()->get() return a classed CacheItem object I experienced various other exceptions being catched while they shouldn't making the unit testing really hard to debug until I found that out.
Comment | File | Size | Author |
---|---|---|---|
#3 | 1799908-3-cache_database_database_exception.patch | 1.78 KB | pounard |
#1 | 1799908-1-cache_database_pdo_exception.patch | 1.36 KB | pounard |
Comments
Comment #1
pounardComment #3
pounardShould catch DatabaseExceptionWrapper instead of PDOException.
Comment #11
Anonymous (not verified) CreditAttribution: Anonymous commented