diff --git a/src/Caching/Cache.php b/src/Caching/Cache.php index 7a451aa1..dde81e24 100644 --- a/src/Caching/Cache.php +++ b/src/Caching/Cache.php @@ -129,6 +129,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;