public static RuntimeException wrapThrowable(Throwable t, String message) {
		if (message != null) {
			return new ZooKeeperAccessException(message, t);
		}
		if (t instanceof RuntimeException) {
			return (RuntimeException) t;
		}
		else {
			return new ZooKeeperAccessException(t.getMessage(), t);
		}
	}
Utility method to wrap a Throwable in a {@link ZooKeeperAccessException}.
@param t the throwable
@param message use this message if not null
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/zookeeper/ZooKeeperUtils.java