Fix wrong exception being thrown on invalid instance types passed to 'executor'.

This commit is contained in:
Daniele Alessandri
2011-06-02 23:41:12 +02:00
parent 3f2814c254
commit b72b12c5cd
+4 -1
View File
@@ -26,7 +26,10 @@ class PipelineContext {
if (isset($options['executor'])) {
$executor = $options['executor'];
if (!$executor instanceof IPipelineExecutor) {
throw new \ArgumentException();
throw new \InvalidArgumentException(
'The executor option accepts only instances ' .
'of Predis\Pipeline\IPipelineExecutor'
);
}
return $executor;
}