From ee902c7c6509a1f6f103a4ef4e3db9241297c2ab Mon Sep 17 00:00:00 2001 From: Jakub Skoczen Date: Wed, 19 Mar 2014 15:56:12 +0100 Subject: [PATCH] Proper exception message --- src/main/java/org/z3950/zing/cql/CQLParser.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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); -- 1.7.10.4