code: @Override
      public boolean isErrorPagePresent(ExternalContext externalContext) {
          
          IServletContext context = (IServletContext) externalContext.getContext();
          WebAppConfig webAppConfig = context.getWebAppConfig();
          return webAppConfig.isErrorPagePresent();
      }
docs: check if the web config defined the error pages