]> git.sur5r.net Git - openldap/blobdiff - contrib/ldapc++/src/LdifReader.cpp
Merge remote-tracking branch 'origin/mdb.master' into OPENLDAP_REL_ENG_2_5
[openldap] / contrib / ldapc++ / src / LdifReader.cpp
index d6dc1bcc4cbe74737586dd9efe89bdf97db2b88c..9db51e83411f93e70931a79792cfaad1eef911e6 100644 (file)
@@ -1,6 +1,6 @@
 // $OpenLDAP$
 /*
- * Copyright 2008, OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 2008-2013 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  */
 
@@ -179,11 +179,12 @@ int LdifReader::readNextRecord( bool first )
 
 LDAPEntry LdifReader::getEntryRecord()
 {
+    std::list<stringpair>::const_iterator i = m_currentRecord.begin();
     if ( m_curRecType != LDAPMsg::SEARCH_ENTRY )
     {
-        // Error
+        throw( std::runtime_error( "The LDIF record: '" + i->second +
+                                   "' is not a valid LDAP Entry" ));
     }
-    std::list<stringpair>::const_iterator i = m_currentRecord.begin();
     LDAPEntry resEntry(i->second);
     i++;
     LDAPAttribute curAttr(i->first);