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 Nov 24, 2015
1 parent 396bacf commit a588a12
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 @@ -127,6 +127,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 a588a12

Please sign in to comment.