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

This commit is contained in:
Daniele Alessandri
2010-05-17 19:46:28 +02:00
parent eab70fb134
commit a26932b3b5
+2 -2
View File
@@ -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;