code: protected void registerToplevelSecurityExceptions() {
  
      this.securityExceptions.add(SecurityException.class);
      this.securityExceptions.add(SecurityErrorUserException.class);
      registerToplevelSecurityExceptions("org.springframework.security.access.AccessDeniedException");
      registerToplevelSecurityExceptions("org.springframework.security.authentication.AuthenticationServiceException");
      registerToplevelSecurityExceptions(
          "org.springframework.security.authentication.AuthenticationCredentialsNotFoundException");
      registerToplevelSecurityExceptions("org.springframework.security.authentication.BadCredentialsException");
      registerToplevelSecurityExceptions("org.springframework.security.authentication.AccountExpiredException");
    }
docs: This method registers the {@link #registerToplevelSecurityException(Class) top-level security exceptions}. You may
  override it to add additional or other classes.