Improve ext/session error messages
diff --git a/system/libraries/Session/drivers/Session_database_driver.php b/system/libraries/Session/drivers/Session_database_driver.php
index 3ba9d3d..da03312 100644
--- a/system/libraries/Session/drivers/Session_database_driver.php
+++ b/system/libraries/Session/drivers/Session_database_driver.php
@@ -127,7 +127,7 @@
 	{
 		if (empty($this->_db->conn_id) && ! $this->_db->db_connect())
 		{
-			return $this->_failure;
+			return $this->_fail();
 		}
 
 		return $this->_success;
@@ -163,7 +163,7 @@
 				$this->_db->where('ip_address', $_SERVER['REMOTE_ADDR']);
 			}
 
-			if (($result = $this->_db->get()->row()) === NULL)
+			if ( ! ($result = $this->_db->get()) OR $result->row() === NULL)
 			{
 				// PHP7 will reuse the same SessionHandler object after
 				// ID regeneration, so we need to explicitly set this to
@@ -210,7 +210,7 @@
 		{
 			if ( ! $this->_release_lock() OR ! $this->_get_lock($session_id))
 			{
-				return $this->_failure;
+				return $this->_fail();
 			}
 
 			$this->_row_exists = FALSE;
@@ -218,7 +218,7 @@
 		}
 		elseif ($this->_lock === FALSE)
 		{
-			return $this->_failure;
+			return $this->_fail();
 		}
 
 		if ($this->_row_exists === FALSE)
@@ -237,7 +237,7 @@
 				return $this->_success;
 			}
 
-			return $this->_failure;
+			return $this->_fail();
 		}
 
 		$this->_db->where('id', $session_id);
@@ -260,7 +260,7 @@
 			return $this->_success;
 		}
 
-		return $this->_failure;
+		return $this->_fail();
 	}
 
 	// ------------------------------------------------------------------------
@@ -275,7 +275,7 @@
 	public function close()
 	{
 		return ($this->_lock && ! $this->_release_lock())
-			? $this->_failure
+			? $this->_fail()
 			: $this->_success;
 	}
 
@@ -304,7 +304,7 @@
 
 			if ( ! $this->_db->delete($this->_config['save_path']))
 			{
-				return $this->_failure;
+				return $this->_fail();
 			}
 		}
 
@@ -314,7 +314,7 @@
 			return $this->_success;
 		}
 
-		return $this->_failure;
+		return $this->_fail();
 	}
 
 	// ------------------------------------------------------------------------
@@ -334,7 +334,7 @@
 
 		return ($this->_db->delete($this->_config['save_path'], 'timestamp < '.(time() - $maxlifetime)))
 			? $this->_success
-			: $this->_failure;
+			: $this->_fail();
 	}
 
 	// ------------------------------------------------------------------------
@@ -414,5 +414,4 @@
 
 		return parent::_release_lock();
 	}
-
 }
\ No newline at end of file
diff --git a/system/libraries/Session/drivers/Session_memcached_driver.php b/system/libraries/Session/drivers/Session_memcached_driver.php
index 4bd6399..88eb4b3 100644
--- a/system/libraries/Session/drivers/Session_memcached_driver.php
+++ b/system/libraries/Session/drivers/Session_memcached_driver.php
@@ -117,7 +117,7 @@
 		{
 			$this->_memcached = NULL;
 			log_message('error', 'Session: Invalid Memcached save path format: '.$this->_config['save_path']);
-			return $this->_failure;
+			return $this->_fail();
 		}
 
 		foreach ($matches as $match)
@@ -142,7 +142,7 @@
 		if (empty($server_list))
 		{
 			log_message('error', 'Session: Memcached server pool is empty.');
-			return $this->_failure;
+			return $this->_fail();
 		}
 
 		return $this->_success;
@@ -170,7 +170,7 @@
 			return $session_data;
 		}
 
-		return $this->_failure;
+		return $this->_fail();
 	}
 
 	// ------------------------------------------------------------------------
@@ -188,14 +188,14 @@
 	{
 		if ( ! isset($this->_memcached))
 		{
-			return $this->_failure;
+			return $this->_fail();
 		}
 		// Was the ID regenerated?
 		elseif ($session_id !== $this->_session_id)
 		{
 			if ( ! $this->_release_lock() OR ! $this->_get_lock($session_id))
 			{
-				return $this->_failure;
+				return $this->_fail();
 			}
 
 			$this->_fingerprint = md5('');
@@ -218,7 +218,7 @@
 					return $this->_success;
 				}
 
-				return $this->_failure;
+				return $this->_fail();
 			}
 
 			if (
@@ -230,7 +230,7 @@
 			}
 		}
 
-		return $this->_failure;
+		return $this->_fail();
 	}
 
 	// ------------------------------------------------------------------------
@@ -249,14 +249,14 @@
 			$this->_release_lock();
 			if ( ! $this->_memcached->quit())
 			{
-				return $this->_failure;
+				return $this->_fail();
 			}
 
 			$this->_memcached = NULL;
 			return $this->_success;
 		}
 
-		return $this->_failure;
+		return $this->_fail();
 	}
 
 	// ------------------------------------------------------------------------
@@ -278,7 +278,7 @@
 			return $this->_success;
 		}
 
-		return $this->_failure;
+		return $this->_fail();
 	}
 
 	// ------------------------------------------------------------------------
diff --git a/system/libraries/Session/drivers/Session_redis_driver.php b/system/libraries/Session/drivers/Session_redis_driver.php
index 7b7951f..cc242dd 100644
--- a/system/libraries/Session/drivers/Session_redis_driver.php
+++ b/system/libraries/Session/drivers/Session_redis_driver.php
@@ -131,7 +131,7 @@
 	{
 		if (empty($this->_config['save_path']))
 		{
-			return $this->_failure;
+			return $this->_fail();
 		}
 
 		$redis = new Redis();
@@ -153,7 +153,7 @@
 			return $this->_success;
 		}
 
-		return $this->_failure;
+		return $this->_fail();
 	}
 
 	// ------------------------------------------------------------------------
@@ -183,7 +183,7 @@
 			return $session_data;
 		}
 
-		return $this->_failure;
+		return $this->_fail();
 	}
 
 	// ------------------------------------------------------------------------
@@ -201,14 +201,14 @@
 	{
 		if ( ! isset($this->_redis))
 		{
-			return $this->_failure;
+			return $this->_fail();
 		}
 		// Was the ID regenerated?
 		elseif ($session_id !== $this->_session_id)
 		{
 			if ( ! $this->_release_lock() OR ! $this->_get_lock($session_id))
 			{
-				return $this->_failure;
+				return $this->_fail();
 			}
 
 			$this->_key_exists = FALSE;
@@ -227,15 +227,15 @@
 					return $this->_success;
 				}
 
-				return $this->_failure;
+				return $this->_fail();
 			}
 
 			return ($this->_redis->setTimeout($this->_key_prefix.$session_id, $this->_config['expiration']))
 				? $this->_success
-				: $this->_failure;
+				: $this->_fail();
 		}
 
-		return $this->_failure;
+		return $this->_fail();
 	}
 
 	// ------------------------------------------------------------------------
@@ -255,9 +255,9 @@
 				if ($this->_redis->ping() === '+PONG')
 				{
 					$this->_release_lock();
-					if ($this->_redis->close() === $this->_failure)
+					if ($this->_redis->close() === $this->_fail())
 					{
-						return $this->_failure;
+						return $this->_fail();
 					}
 				}
 			}
@@ -296,7 +296,7 @@
 			return $this->_success;
 		}
 
-		return $this->_failure;
+		return $this->_fail();
 	}
 
 	// ------------------------------------------------------------------------