diff --git a/src/Caching/Cache.php b/src/Caching/Cache.php index 0ef120c7..1e0fccb1 100644 --- a/src/Caching/Cache.php +++ b/src/Caching/Cache.php @@ -127,6 +127,9 @@ public function save($key, $data, array $dependencies = NULL) $this->storage->lock($key); try { $data = call_user_func_array($data, array(& $dependencies)); + } catch (\Throwable $e) { + $this->storage->remove($key); + throw $e; } catch (\Exception $e) { $this->storage->remove($key); throw $e;