diff --git a/src/cz/zipek/sqflint/linter/Linter.java b/src/cz/zipek/sqflint/linter/Linter.java index 0eb7f47..fa60190 100644 --- a/src/cz/zipek/sqflint/linter/Linter.java +++ b/src/cz/zipek/sqflint/linter/Linter.java @@ -65,6 +65,8 @@ public int start() throws IOException { } else { getErrors().add((SQFParseException)e); } + } catch (TokenMgrError e) { + getErrors().add(new SQFParseException(e)); } finally { postParse(); diff --git a/src/cz/zipek/sqflint/linter/SQFParseException.java b/src/cz/zipek/sqflint/linter/SQFParseException.java index 56fc0f0..9d37944 100644 --- a/src/cz/zipek/sqflint/linter/SQFParseException.java +++ b/src/cz/zipek/sqflint/linter/SQFParseException.java @@ -2,6 +2,7 @@ import cz.zipek.sqflint.parser.ParseException; import cz.zipek.sqflint.parser.Token; +import cz.zipek.sqflint.parser.TokenMgrError; /** * @@ -24,6 +25,13 @@ public SQFParseException(ParseException ex) { jsonMessage = buildMessage(ex, false); } + public SQFParseException(TokenMgrError ex) { + super(ex.getMessage()); + + currentToken = null; + jsonMessage = ex.getMessage(); + } + public String getJSONMessage() { return jsonMessage; }