Skip to content

Commit 8965571

Browse files
committed
Cache::save() handles Throwable errors
1 parent f24234f commit 8965571

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
@@ -129,6 +129,9 @@ public function save($key, $data, array $dependencies = NULL)
129129
$this->storage->lock($key);
130130
try {
131131
$data = call_user_func_array($data, array(& $dependencies));
132+
} catch (\Throwable $e) {
133+
$this->storage->remove($key);
134+
throw $e;
132135
} catch (\Exception $e) {
133136
$this->storage->remove($key);
134137
throw $e;

0 commit comments

Comments
 (0)