Fix #4044
diff --git a/system/libraries/Cache/drivers/Cache_redis.php b/system/libraries/Cache/drivers/Cache_redis.php
index 2825acf..ea0059f 100644
--- a/system/libraries/Cache/drivers/Cache_redis.php
+++ b/system/libraries/Cache/drivers/Cache_redis.php
@@ -117,17 +117,17 @@
 			{
 				log_message('error', 'Cache: Redis connection failed. Check your configuration.');
 			}
+
+			if (isset($config['password']) && ! $this->_redis->auth($config['password']))
+			{
+				log_message('error', 'Cache: Redis authentication failed.');
+			}
 		}
 		catch (RedisException $e)
 		{
 			log_message('error', 'Cache: Redis connection refused ('.$e->getMessage().')');
 		}
 
-		if (isset($config['password']) && ! $this->_redis->auth($config['password']))
-		{
-			log_message('error', 'Cache: Redis authentication failed.');
-		}
-
 		// Initialize the index of serialized values.
 		$serialized = $this->_redis->sMembers('_ci_redis_serialized');
 		empty($serialized) OR $this->_serialized = array_flip($serialized);