Skip to content

Commit

Permalink
Cache::save() handles Throwable errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Dec 3, 2015
1 parent f24234f commit 8965571
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Caching/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8965571

Please sign in to comment.