Im using DirContext for connection to LDAP server. How to get information about errors of this context? Server is not avaliable, password not correct or user is blocked and etc
Hashtable<String, String> envoironment = new Hashtable<>();
envoironment.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
// envoironment.put(Context.PROVIDER_URL, "******");
envoironment.put(Context.PROVIDER_URL, "******");
envoironment.put(Context.SECURITY_AUTHENTICATION,
"simple");
envoironment.put(Context.SECURITY_PRINCIPAL, username
+ "@somdomain.com");
envoironment.put(Context.SECURITY_CREDENTIALS,
password);
DirContext context = new InitialDirContext(envoironment);