Skip to content

Commit

Permalink
(#13) Misc. exception message improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
mecha committed Jul 8, 2020
1 parent 0388a59 commit 156ede7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/CachePool.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function set($key, $value, $ttl = null)
? $this->getIntervalDuration($ttl)
: $ttl;
} catch (Exception $e) {
throw new CacheException(sprintf('Could not normalize cache TTL'));
throw new CacheException(sprintf('Could not normalize cache TTL: %s', $e->getMessage()));
}

if (!is_int($ttl)) {
Expand Down Expand Up @@ -202,15 +202,15 @@ public function getMultiple($keys, $default = null)
public function setMultiple($values, $ttl = null)
{
if (!is_iterable($values)) {
throw new InvalidArgumentException(sprintf('List of keys is not a list'));
throw new InvalidArgumentException(sprintf('List of keys is not an iterable value'));
}

try {
$ttl = $ttl instanceof DateInterval
? $this->getIntervalDuration($ttl)
: $ttl;
} catch (Exception $e) {
throw new CacheException(sprintf('Could not normalize cache TTL'));
throw new CacheException(sprintf('Could not normalize cache TTL: %s', $e->getMessage()));
}

foreach ($values as $key => $value) {
Expand Down

0 comments on commit 156ede7

Please sign in to comment.