mirror of
https://github.com/predis/predis.git
synced 2026-09-04 23:08:00 +00:00
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:
+2
-2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user