Browse Source

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

Daniele Alessandri 15 years ago
parent
commit
a26932b3b5
1 changed files with 2 additions and 2 deletions
  1. 2 2
      lib/Predis.php

+ 2 - 2
lib/Predis.php

@@ -711,7 +711,7 @@ class CommandPipeline {
 
 
     public function execute($block = null) {
     public function execute($block = null) {
         if ($block && !is_callable($block)) {
         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
         // TODO: do not reuse previously executed pipelines
@@ -779,7 +779,7 @@ class MultiExecBlock {
 
 
     public function execute($block = null) {
     public function execute($block = null) {
         if ($block && !is_callable($block)) {
         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;
         $blockException = null;