mirror of
https://github.com/predis/predis.git
synced 2026-09-14 20:37:29 +00:00
Fix a few exceptions.
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
namespace Predis\Connection;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use UnexpectedValueException;
|
||||
use ReflectionClass;
|
||||
use Predis\Command\RawCommand;
|
||||
|
||||
@@ -94,7 +95,7 @@ class Factory implements FactoryInterface
|
||||
}
|
||||
|
||||
if (!$connection instanceof SingleConnectionInterface) {
|
||||
throw new InvalidArgumentException(
|
||||
throw new UnexpectedValueException(
|
||||
"Objects returned by connection initializers must implement ".
|
||||
"'Predis\Connection\SingleConnectionInterface'."
|
||||
);
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace Predis\Response\Iterator;
|
||||
|
||||
use OuterIterator;
|
||||
use RuntimeException;
|
||||
use InvalidArgumentException;
|
||||
use UnexpectedValueException;
|
||||
|
||||
/**
|
||||
@@ -49,7 +49,7 @@ class MultiBulkTuple extends MultiBulk implements OuterIterator
|
||||
protected function checkPreconditions(MultiBulk $iterator)
|
||||
{
|
||||
if ($iterator->getPosition() !== 0) {
|
||||
throw new RuntimeException(
|
||||
throw new InvalidArgumentException(
|
||||
'Cannot initialize a tuple iterator using an already initiated iterator.'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -318,7 +318,7 @@ class MultiExec implements BasicClientInterface, ExecutableContextInterface
|
||||
} elseif ($this->attempts) {
|
||||
$this->discard();
|
||||
|
||||
throw new InvalidArgumentException(
|
||||
throw new ClientException(
|
||||
'Automatic retries are supported only when a callable block is provided.'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ class MultiBulkTupleTest extends PredisTestCase
|
||||
{
|
||||
/**
|
||||
* @group disconnected
|
||||
* @expectedException RuntimeException
|
||||
* @expectedException InvalidArgumentException
|
||||
* @expectedExceptionMessage Cannot initialize a tuple iterator using an already initiated iterator.
|
||||
*/
|
||||
public function testInitiatedMultiBulkIteratorsAreNotValid()
|
||||
|
||||
@@ -368,7 +368,7 @@ class MultiExecTest extends PredisTestCase
|
||||
|
||||
/**
|
||||
* @group disconnected
|
||||
* @expectedException InvalidArgumentException
|
||||
* @expectedException Predis\ClientException
|
||||
* @expectedExceptionMessage Automatic retries are supported only when a callable block is provided.
|
||||
*/
|
||||
public function testThrowsExceptionOnAutomaticRetriesWithFluentInterface()
|
||||
|
||||
Reference in New Issue
Block a user