private static void configureErrorReportValve(final TomcatServletWebServerFactory tomcat) {
        tomcat.addContextCustomizers(context -> {
            val parent = context.getParent();
            if (parent instanceof final StandardHost standardHost) {
                standardHost.setErrorReportValveClass(CasErrorReportValve.class.getName());
                val errorReportValve = new CasErrorReportValve();
                errorReportValve.setShowServerInfo(false);
                standardHost.addValve(errorReportValve);
            }
        });
    }
This is {@link CasTomcatServletWebServerFactoryCustomizer}.

@author Misagh Moayyed
@since 6.1.0
webapp/cas-server-webapp-init-tomcat/src/main/java/org/apereo/cas/tomcat/CasTomcatServletWebServerFactoryCustomizer.java