From: Jakub Skoczen Date: Wed, 19 Mar 2014 14:56:12 +0000 (+0100) Subject: Proper exception message X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=ee902c7c6509a1f6f103a4ef4e3db9241297c2ab;p=cql-java-moved-to-github.git Proper exception message --- diff --git a/src/main/java/org/z3950/zing/cql/CQLParser.java b/src/main/java/org/z3950/zing/cql/CQLParser.java index 8a0fc17..cbe64d5 100644 --- a/src/main/java/org/z3950/zing/cql/CQLParser.java +++ b/src/main/java/org/z3950/zing/cql/CQLParser.java @@ -244,14 +244,15 @@ public class CQLParser { if (!isRelation()) break; //we're done if no relation + //render relation + String relstr = (lexer.what() == CQLTokenizer.TT_WORD ? + lexer.value() : lexer.render(lexer.what(), false)); //we have relation, but it only makes sense if preceded by a single term if (all.length() > first.length()) { - throw new CQLParseException("unexpected relation '"+lexer.value()+"'" + throw new CQLParseException("unexpected relation '"+relstr+"'" , lexer.pos()); } index = first; - String relstr = (lexer.what() == CQLTokenizer.TT_WORD ? - lexer.value() : lexer.render(lexer.what(), false)); relation = new CQLRelation(relstr); match(lexer.what()); ModifierSet ms = gatherModifiers(relstr);