wrap function from getting result code from ldap results