lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominic Dsouza (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (LUCENE-6876) QueryNodeParseException is thrown without proper Error information
Date Mon, 02 Nov 2015 12:37:27 GMT

     [ https://issues.apache.org/jira/browse/LUCENE-6876?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Dominic Dsouza updated LUCENE-6876:
-----------------------------------
    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:

{code}
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;
      }
    }
{code}

  was:
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;
      }
    }



> QueryNodeParseException is thrown without proper Error information
> ------------------------------------------------------------------
>
>                 Key: LUCENE-6876
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6876
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: core/queryparser
>    Affects Versions: 5.3
>            Reporter: Dominic Dsouza
>
> 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:
> {code}
> 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;
>       }
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message