瀏覽代碼

Fix helper method for invalid options in connection classes.

This fix is needed since connection parameters do not respond to __toString()
anymore after recent changes.
Daniele Alessandri 13 年之前
父節點
當前提交
608c48146f
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      lib/Predis/Connection/AbstractConnection.php

+ 4 - 2
lib/Predis/Connection/AbstractConnection.php

@@ -177,9 +177,11 @@ abstract class AbstractConnection implements SingleConnectionInterface
      */
     protected function onInvalidOption($option, $parameters = null)
     {
-        $message = "Invalid option: $option";
+        $class = get_called_class();
+        $message = "Invalid option for connection $class: $option";
+
         if (isset($parameters)) {
-            $message .= " [$parameters]";
+            $message .= sprintf(' [%s => %s]', $option, $parameters->{$option});
         }
 
         throw new NotSupportedException($message);