public static Throwable getRootCause(final Throwable t) {
        final Throwable root = ExceptionUtils.getRootCause(t);
        return null == root ? t : root;
    }
A wrapper to Commons Lang {@code ExceptionUtils.getRootCause(Throwable)} which ensures that the root is either
an inner cause to the exception or the exception itself (rather than {@code null}).
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/ExceptionHelper.java