Skip to content

Commit fbc3ebf

Browse files
committed
Cache::save() handles Throwable errors
1 parent ec691ce commit fbc3ebf

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
@@ -123,6 +123,9 @@ public function save($key, $data, array $dependencies = NULL)
123123
$this->storage->lock($key);
124124
try {
125125
$data = call_user_func_array($data, [& $dependencies]);
126+
} catch (\Throwable $e) {
127+
$this->storage->remove($key);
128+
throw $e;
126129
} catch (\Exception $e) {
127130
$this->storage->remove($key);
128131
throw $e;

0 commit comments

Comments
 (0)