code: private void addInfoForNoSuchElementException(NoSuchElementException cause) {
          if (parent == null) {
              throw cause;
          }
  
          BasicPageImpl page = this.parent.getCurrentPage();
  
          if (page == null) {
              throw cause;
          }
  
          String resolvedPageName = page.getClass().getSimpleName();
  
          // Find if page exists: This part is reached after a valid page instance is assigned to page variable. So its
          // safe to proceed!
  
          boolean pageExists = page.hasExpectedPageTitle();
          if (!pageExists) {
              // ParentType: Page does not exist: Sending the cause along with it
              throw new ParentNotFoundException(resolvedPageName + " : With Page Title {" + page.getActualPageTitle()
                      + "} Not Found.", cause);
          }
          // The page exists. So lets prepare a detailed error message before throwing the exception.
  
          StringBuilder msg = new StringBuilder("Unable to find webElement ");
  
          if (this.controlName != null) {
              msg.append(this.controlName).append(" on ");
          }
  
          if (resolvedPageName != null) {
              msg.append(resolvedPageName);
          }
  
          msg.append(" using the locator {").append(locator).append("}");
          throw new NoSuchElementException(msg.toString(), cause);
      }
docs: A utility method to provide additional information to the user when a NoSuchElementException is thrown.
  
  @param cause
  The associated cause for the exception.