code: public void printError(SourcePosition pos, String msg) {
          if (diagListener != null) {
              report(DiagnosticType.ERROR, pos, msg);
              return;
          }
  
          if (nerrors < MaxErrors) {
              String prefix = (pos == null) ? programName : pos.toString();
              errWriter.println(prefix + ": " + getText("javadoc.error") + " - " + msg);
              errWriter.flush();
              prompt();
              nerrors++;
          }
      }
docs: Print error message, increment error count.
  Part of DocErrorReporter.
  
  @param pos the position where the error occurs
  @param msg message to print