public function getError($i = null, $toString = true)
	{
		// Find the error
		if ($i === null)
		{
			// Default, return the last message
			$error = end($this->_errors);
		}
		elseif (!array_key_exists($i, $this->_errors))
		{
			// If $i has been specified but does not exist, return false
			return false;
		}
		else
		{
			$error = $this->_errors[$i];
		}

		// Check if only the string is requested
		if ($error instanceof Exception && $toString)
		{
			return (string) $error;
		}

		return $error;
	}
public function getError($i = null, $toString = true)
	{
		// Find the error
		if ($i === null)
		{
			// Default, return the last message
			$error = end($this->_errors);
		}
		elseif (!array_key_exists($i, $this->_errors))
		{
			// If $i has been specified but does not exist, return false
			return false;
		}
		else
		{
			$error = $this->_errors[$i];
		}

		// Check if only the string is requested
		if ($error instanceof Exception && $toString)
		{
			return (string) $error;
		}

		return $error;
	}
public function getError ( $ i = null , $ toString = true ) { // Find the error if ( $ i === null ) { // Default, return the last message $ error = end ( $ this -> _errors ) ; } elseif ( ! array_key_exists ( $ i , $ this -> _errors ) ) { // If $i has been specified but does not exist, return false return false ; } else { $ error = $ this -> _errors [ $ i ] ; } // Check if only the string is requested if ( $ error instanceof Exception && $ toString ) { return ( string ) $ error ; } return $ error ; }
Get the most recent error message.

@param   integer  $i         Option error index.
@param   boolean  $toString  Indicates if error objects should return their error message.
@return  string   Error message
Get the most recent error message .