Skip to content

Commit d51db8f

Browse files
committed
Cache::save() handles Throwable errors
1 parent dbd941a commit d51db8f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Caching/Cache.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ public function save($key, $data, array $dependencies = NULL)
127127
$this->storage->lock($key);
128128
try {
129129
$data = call_user_func_array($data, [& $dependencies]);
130+
} catch (\Throwable $e) {
131+
$this->storage->remove($key);
132+
throw $e;
130133
} catch (\Exception $e) {
131134
$this->storage->remove($key);
132135
throw $e;

0 commit comments

Comments
 (0)