Skip to content

Commit f64932f

Browse files
authored
Improve logging (#129)
* Updated change log * Improve logging
1 parent 72ddc94 commit f64932f

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

AbstractCachePool.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,8 @@ public function deleteItems(array $keys)
220220
public function save(CacheItemInterface $item)
221221
{
222222
if (!$item instanceof PhpCacheItem) {
223-
throw new InvalidArgumentException('Cache items are not transferable between pools. Item MUST implement PhpCacheItem.');
223+
$e = new InvalidArgumentException('Cache items are not transferable between pools. Item MUST implement PhpCacheItem.');
224+
$this->handleException($e, __FUNCTION__);
224225
}
225226

226227
$this->removeTagEntries($item);
@@ -275,16 +276,18 @@ public function commit()
275276
protected function validateKey($key)
276277
{
277278
if (!is_string($key)) {
278-
throw new InvalidArgumentException(sprintf(
279+
$e = new InvalidArgumentException(sprintf(
279280
'Cache key must be string, "%s" given', gettype($key)
280281
));
282+
$this->handleException($e, __FUNCTION__);
281283
}
282284

283285
if (preg_match('|[\{\}\(\)/\\\@\:]|', $key)) {
284-
throw new InvalidArgumentException(sprintf(
286+
$e = new InvalidArgumentException(sprintf(
285287
'Invalid key: "%s". The key contains one or more characters reserved for future extension: {}()/\@:',
286288
$key
287289
));
290+
$this->handleException($e, __FUNCTION__);
288291
}
289292
}
290293

Changelog.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,13 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" betwee
1010
* `AbstractCachePool::invalidateTags` and `AbstractCachePool::invalidateTags`
1111
* Added interfaces for our items and pools `PhpCachePool` and `PhpCacheItem`
1212
* Trait to help adapters to support tags. `TagSupportWithArray`.
13-
* New interfaces for tags. `TaggableCacheItemInterface` and `TaggableCacheItemPoolInterface`
1413

1514
### Changed
1615

1716
* First parameter to `AbstractCachePool::storeItemInCache` must be a `PhpCacheItem`.
1817
* Return value from `AbstractCachePool::fetchObjectFromCache` must be a an array with 4 values. Added expiration timestamp.
1918
* `HasExpirationDateInterface` is replaced by `HasExpirationTimestampInterface`
20-
* We do not work with `\DateTime` anymore. We work with timestamps.
19+
* We do not work with `\DateTime` internally anymore. We work with timestamps.
2120

2221
## 0.3.3
2322

0 commit comments

Comments
 (0)