From a26932b3b578d64979f103e3032bf770aa92b653 Mon Sep 17 00:00:00 2001 From: Daniele Alessandri Date: Mon, 17 May 2010 19:46:28 +0200 Subject: [PATCH] Throw a more appropriate InvalidArgumentException when a non-callable argument is passed to instances of Predis\CommandPipeline and Predis\MultiExecBlock. --- lib/Predis.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Predis.php b/lib/Predis.php index 8ea222e5..c20beadd 100644 --- a/lib/Predis.php +++ b/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;