From eab70fb1349a310d95e8caca985ed9406017985c Mon Sep 17 00:00:00 2001 From: Daniele Alessandri Date: Mon, 17 May 2010 19:42:08 +0200 Subject: [PATCH] Implement the new EmptyRingException exception class. --- lib/Predis.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Predis.php b/lib/Predis.php index 00793c44..8ea222e5 100644 --- a/lib/Predis.php +++ b/lib/Predis.php @@ -1543,6 +1543,8 @@ class Shared { } } +class EmptyRingException extends \Exception { } + class HashRing implements \Predis\IDistributionAlgorithm { const DEFAULT_REPLICAS = 128; const DEFAULT_WEIGHT = 100; @@ -1598,7 +1600,7 @@ class HashRing implements \Predis\IDistributionAlgorithm { return; } if (count($this->_nodes) === 0) { - throw new \LogicException('Cannot initialize empty hashring'); + throw new \EmptyRingException('Cannot initialize empty hashring'); } $this->_ring = array();