Explorar o código

Fix wrong exception being thrown on invalid instance types passed to 'executor'.

Daniele Alessandri %!s(int64=14) %!d(string=hai) anos
pai
achega
b72b12c5cd
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      lib/Predis/Pipeline/PipelineContext.php

+ 4 - 1
lib/Predis/Pipeline/PipelineContext.php

@@ -26,7 +26,10 @@ class PipelineContext {
         if (isset($options['executor'])) {
             $executor = $options['executor'];
             if (!$executor instanceof IPipelineExecutor) {
-                throw new \ArgumentException();
+                throw new \InvalidArgumentException(
+                    'The executor option accepts only instances ' .
+                    'of Predis\Pipeline\IPipelineExecutor'
+                );
             }
             return $executor;
         }