Fixed #21200 -- Consistantly raise errors across all cache backends.

Thanks to tchaumeny for the patch.