public static String format(final Throwable t) { Throwable throwable = t; if (IllegalStateException.class.isInstance(throwable)) { throwable = throwable.getCause(); } final Throwable rootCause = ExceptionUtils.getRootCause(throwable) == null ? throwable : ExceptionUtils.getRootCause(throwable); String exceptionSimpleName = rootCause.getClass().getSimpleName(); String message = rootCause.getMessage(); if (LdapException.class.isInstance(throwable)) { LdapException le = LdapException.class.cast(throwable); // unwrap underlying exception if appropriate exceptionSimpleName = le.getCause() == null ? le.getClass().getSimpleName() : le.getCause().getClass().getSimpleName(); if (LdapReferralException.class.isInstance(le.getCause())) { final LdapReferralException ldapReferralException = LdapReferralException.class.cast(le.getCause()); message = "Referral error, remaining name '" + ldapReferralException.getRemainingName().toString() + "'"; } if (NameNotFoundException.class.isInstance(le.getCause())) { final NameNotFoundException nameNotFoundException = NameNotFoundException.class.cast(le.getCause()); message = "Name not found error, remaining name '" + nameNotFoundException.getRemainingName().toString() + "'"; } final StringBuilder sb = new StringBuilder(); sb.append("[").append(exceptionSimpleName).append("] "); sb.append(message); if (le.getResultCode() != null) { sb.append(" [result code = ").append(le.getResultCode().name()).append("]"); } return sb.toString(); } return "Error occurred: [" + exceptionSimpleName + "] " + message; }
System.err.println("LDAP Operation failed:"); ex.printStackTrace(System.err); if (ex.getResultCode() != null) { status = ex.getResultCode().value();
System.err.println("LDAP Operation failed:"); ex.printStackTrace(System.err); if (ex.getResultCode() != null) { status = ex.getResultCode().value();
System.err.println("LDAP Operation failed:"); ex.printStackTrace(System.err); if (ex.getResultCode() != null) { status = ex.getResultCode().value();
/** {@inheritDoc} */ @Override @Nullable public StorageRecord read(@Nonnull @NotEmpty final String context, @Nonnull @NotEmpty final String key) throws IOException { SearchResult result = null; try { result = search(context, key).getResult(); } catch (LdapException e) { if (e.getResultCode() != ResultCode.NO_SUCH_OBJECT) { log.error("LDAP search operation failed", e); throw new IOException(e); } } StorageRecord record = null; if (result != null && result.size() > 0) { final LdapEntry entry = result.getEntry(); if (entry != null) { final LdapAttribute attr = entry.getAttribute(key); if (attr != null) { record = new StorageRecord(attr.getStringValue(), null); } } } return record; }
} catch (LdapException e) { logger.warn("Could not follow referral to " + url, e); if (e.getResultCode() == ResultCode.REFERRAL_LIMIT_EXCEEDED) { throw e;
} catch (LdapException e) { logger.warn("Could not follow referral to " + url, e); if (e.getResultCode() == ResultCode.REFERRAL_LIMIT_EXCEEDED) { throw e;
} catch (LdapException e) { logger.warn("Could not follow referral to " + url, e); if (e.getResultCode() == ResultCode.REFERRAL_LIMIT_EXCEEDED) { throw e;
connResponse.getMessageId()); } catch (LdapException e) { if (e.getResultCode() != null) { response = new AuthenticationHandlerResponse( false, e.getResultCode(), c, e.getMessage(),
connResponse.getMessageId()); } catch (LdapException e) { if (e.getResultCode() != null) { response = new AuthenticationHandlerResponse( false, e.getResultCode(), c, e.getMessage(),
bindResponse.getMessageId()); } catch (LdapException e) { if (e.getResultCode() != null) { response = new AuthenticationHandlerResponse( false, e.getResultCode(), c, e.getMessage(),
connResponse.getMessageId()); } catch (LdapException e) { if (e.getResultCode() != null) { response = new AuthenticationHandlerResponse( false, e.getResultCode(), c, e.getMessage(),
bindResponse.getMessageId()); } catch (LdapException e) { if (e.getResultCode() != null) { response = new AuthenticationHandlerResponse( false, e.getResultCode(), c, e.getMessage(),
bindResponse.getMessageId()); } catch (LdapException e) { if (e.getResultCode() != null) { response = new AuthenticationHandlerResponse( false, e.getResultCode(), c, e.getMessage(),
SearchRequest.newObjectScopeSearchRequest(sourceEntry.getDn(), request.getSearchAttributes())); } catch (LdapException e) { if (e.getResultCode() != ResultCode.NO_SUCH_OBJECT) { throw e;
SearchRequest.newObjectScopeSearchRequest(sourceEntry.getDn(), request.getSearchAttributes())); } catch (LdapException e) { if (e.getResultCode() != ResultCode.NO_SUCH_OBJECT) { throw e;
SearchRequest.newObjectScopeSearchRequest(sourceEntry.getDn(), request.getSearchAttributes())); } catch (LdapException e) { if (e.getResultCode() != ResultCode.NO_SUCH_OBJECT) { throw e;