Class: LDAP::Conn

Inherits:
Object
  • Object
show all
Defined in:
lib/active_ldap/adapter/ldap_ext.rb

Instance Method Summary collapse

Instance Method Details

#assert_error_codeObject

Raises:

  • (klass)


61
62
63
64
65
66
67
# File 'lib/active_ldap/adapter/ldap_ext.rb', line 61

def assert_error_code
  return unless failed?
  klass = ActiveLdap::LdapError::ERRORS[err]
  klass ||= IMPLEMENT_SPECIFIC_ERRORS[err]
  klass ||= ActiveLdap::LdapError
  raise klass, LDAP.err2string(err)
end

#error_messageObject



53
54
55
56
57
58
59
# File 'lib/active_ldap/adapter/ldap_ext.rb', line 53

def error_message
  if failed?
    LDAP.err2string(err)
  else
    nil
  end
end

#failed?Boolean

Returns:

  • (Boolean)


49
50
51
# File 'lib/active_ldap/adapter/ldap_ext.rb', line 49

def failed?
  not err.zero?
end