spring-projects/spring-xd — pull request #846 by dturanski (2014-05-14 19:12:32+00:00)
Title: XD-1475 Improve ZK exception handling

Added ZooKeeperUtils.

ZooKeeperUtils.wrapThrowable(t) - returns a ZooKeeperAccessException or the original if it is a RuntimeException. This, rather than wrapping and throwing because of constructs like:

````
try {
return ...
}
catch (Exception e) {
wrapAndThrow(e);
}
````
result in an error since the compiler doesn't recognize that the method is guaranteed to throw something. So to avoid this:

````
try {
return ...
}
catch (Exception e) {
throw wrapThrowable(e);
}
````

There is also ZooKeeperUtils.wrapAndThrowIgnoring(Throwable t, Class ignored) that comes up often.