code: public static void handleError(final Node node, final String msg)
      {
          final ErrorHandler handler = (ErrorHandler)node.getOwnerDocument().getUserData(ERROR_HANDLER_KEY);
  
          if (handler == null)
          {
              throw new IllegalStateException("ERROR: " + formatLocationInfo(node) + msg);
          }
          else
          {
              handler.error(formatLocationInfo(node) + msg);
          }
      }
docs: Handle an error condition as consequence of parsing.
  
  @param node that is the context of the warning.
  @param msg  associated with the error.