Browse Source

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 years ago
parent
commit
608c48146f
1 changed files with 4 additions and 2 deletions
  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)
     protected function onInvalidOption($option, $parameters = null)
     {
     {
-        $message = "Invalid option: $option";
+        $class = get_called_class();
+        $message = "Invalid option for connection $class: $option";
+
         if (isset($parameters)) {
         if (isset($parameters)) {
-            $message .= " [$parameters]";
+            $message .= sprintf(' [%s => %s]', $option, $parameters->{$option});
         }
         }
 
 
         throw new NotSupportedException($message);
         throw new NotSupportedException($message);