To simplify resiliency configuration, it is important to chain exceptions in your connector implementation using namingException.initCause(origEx) when wrapping exceptions thrown by native APIs. This allows you to configure retrying with a minimal set of base error messages configured (for example, chained cause may be a socket error).
For example, consider the following code snippet:
try { …native API calls… } catch (NativeException e) { final LdapNamingException ne; ne = new LdapNamingException(msg, ResultCodeEnum.INVALID_CREDENTIALS); ne.initCause(e); throw ne; }
Copyright © 2013 CA.
All rights reserved.
|
|