Update exceptions used in cache engines.

I think this can be changed to `LogicException`, I ten do avoid throwing the base exception class