Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-6876

QueryNodeParseException is thrown without proper Error information

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 5.3
    • None
    • core/queryparser
    • None
    • New

    Description

      Whenever an Error is caught in parse() method of StandardSyntaxParser.java, a new instance of QueryNodeParseException is created without any Error Information(like errorToken, beginColumn, beginLine) and thrown. Following is the parse method:

      public QueryNode parse(CharSequence query, CharSequence field) throws QueryNodeParseException {
            ReInit(new FastCharStream(new StringReader(query.toString())));
            try {
              // TopLevelQuery is a Query followed by the end-of-input (EOF)
              QueryNode querynode = TopLevelQuery(field);
              return querynode;
            }
            catch (ParseException tme) {
                  tme.setQuery(query);
                  throw tme;
            }
            catch (Error tme) {
                Message message = new MessageImpl(QueryParserMessages.INVALID_SYNTAX_CANNOT_PARSE, query, tme.getMessage());
                QueryNodeParseException e = new QueryNodeParseException(tme);
                  e.setQuery(query);
                  e.setNonLocalizedMessage(message);
                  throw e;
            }
          }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            dominicdsouza Dominic Dsouza
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: