Skip to content

Commit

Permalink
(#13) Better exception messages when clearing
Browse files Browse the repository at this point in the history
  • Loading branch information
mecha committed Jul 8, 2020
1 parent 3b702ae commit e6101dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/CachePool.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public function clear()
$keys = $this->getAllKeys();
$this->deleteMultiple($keys);
} catch (Exception|InvalidArgumentExceptionInterface $e) {
throw new CacheException(sprintf('Could not clear cache'), 0, $e);
throw new CacheException(sprintf('Failed to clear cache: %s', $e->getMessage()), 0, $e);
}

return true;
Expand Down Expand Up @@ -227,7 +227,7 @@ public function setMultiple($values, $ttl = null)
public function deleteMultiple($keys)
{
if (!is_iterable($keys)) {
throw new InvalidArgumentException(sprintf('List of keys is not a list'));
throw new InvalidArgumentException('List of keys is not an iterable value');
}

foreach ($keys as $key) {
Expand Down

0 comments on commit e6101dc

Please sign in to comment.