From 156ede75e9361f8981cff428f801c4027dcbd51f Mon Sep 17 00:00:00 2001 From: Miguel Muscat Date: Wed, 8 Jul 2020 11:55:00 +0200 Subject: [PATCH] (#13) Misc. exception message improvements --- src/CachePool.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/CachePool.php b/src/CachePool.php index dd3c0cb..c1ad200 100644 --- a/src/CachePool.php +++ b/src/CachePool.php @@ -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)) { @@ -202,7 +202,7 @@ 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 { @@ -210,7 +210,7 @@ public function setMultiple($values, $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())); } foreach ($values as $key => $value) {