Эх сурвалжийг харах

Throw a more appropriate InvalidArgumentException when a non-callable argument is passed to instances of Predis\CommandPipeline and Predis\MultiExecBlock.

Daniele Alessandri 15 жил өмнө
parent
commit
a26932b3b5
1 өөрчлөгдсөн 2 нэмэгдсэн , 2 устгасан
  1. 2 2
      lib/Predis.php

+ 2 - 2
lib/Predis.php

@@ -711,7 +711,7 @@ class CommandPipeline {
 
     public function execute($block = null) {
         if ($block && !is_callable($block)) {
-            throw new \RuntimeException('Argument passed must be a callable object');
+            throw new \InvalidArgumentException('Argument passed must be a callable object');
         }
 
         // TODO: do not reuse previously executed pipelines
@@ -779,7 +779,7 @@ class MultiExecBlock {
 
     public function execute($block = null) {
         if ($block && !is_callable($block)) {
-            throw new \RuntimeException('Argument passed must be a callable object');
+            throw new \InvalidArgumentException('Argument passed must be a callable object');
         }
 
         $blockException = null;