code: private String findErrorPage(Throwable exception) {
          if (exception instanceof EJBException && exception.getCause() != null) {
              exception = exception.getCause();
          }
          String errorPage = WebXml.INSTANCE.findErrorPageLocation(exception);
  
          return errorPage;
      }
docs: Find error page in web.xml
  
  @param exception
  @return