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

QueryNodeParseException is thrown without proper Error information

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 5.3
    • Fix Version/s: None
    • Component/s: core/queryparser
    • Labels:
      None
    • Lucene Fields:
      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

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

              Dates

              • Created:
                Updated: