private static String consolidateExceptionMessages(final Throwable throwable) {
        val stringBuilder = new StringBuilder();

        var pointer = throwable;

        while (pointer != null) {
            stringBuilder.append("  Caused by: ")
                .append(pointer)
                .append(System.lineSeparator());
            pointer = pointer.getCause();
        }

        return stringBuilder.toString();
    }
This is {@link ValidateEndpointCommand}.

@author Misagh Moayyed
@author John Gasper
@since 5.3.0
support/cas-server-support-shell-core/src/main/java/org/apereo/cas/shell/commands/util/ValidateEndpointCommand.java