Improve MapCacheLRU error message
authorAaron Schulz <aschulz@wikimedia.org>
Tue, 14 Aug 2018 05:52:22 +0000 (22:52 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Tue, 14 Aug 2018 05:52:22 +0000 (22:52 -0700)
Bug: T201893
Change-Id: I74ef2cf31d83186f68e676da1b80c4c44ca28d69

includes/libs/MapCacheLRU.php

index 4f1e7b0..3a549af 100644 (file)
@@ -189,7 +189,9 @@ class MapCacheLRU implements IExpiringStore, Serializable {
                }
 
                if ( !is_array( $this->cache[$key] ) ) {
-                       throw new UnexpectedValueException( "The value of '$key' is not an array." );
+                       $type = gettype( $this->cache[$key] );
+
+                       throw new UnexpectedValueException( "The value of '$key' ($type) is not an array." );
                }
 
                $this->cache[$key][$field] = $value;