code: private static IErrorReporter getErrorReporter(JspTag tag)
      {
          if (tag instanceof IErrorReporter && ((IErrorReporter) tag).isReporting())
              return (IErrorReporter) tag;
  
          // check to see if this tag has is an ErrorReporter or has an ErrorReporter as a parent
          IErrorReporter er = (IErrorReporter) SimpleTagSupport.findAncestorWithClass(tag, IErrorReporter.class);
          while (er != null) {
              if (er.isReporting())
                  return er;
              er = (IErrorReporter) SimpleTagSupport.findAncestorWithClass((JspTag) er, IErrorReporter.class);
          }
          return null;
      }
docs: This method will return the first <code>ErrorReporter</code> in the parental chain of the
  tag.  Searching starts with this tag.
  @return an <code>ErrorReporter</code> if one is found in the parental chain, otherwise null.