Skip to content

Commit

Permalink
Token manager errors should now be treated correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
SkaceKamen committed Nov 12, 2016
1 parent 7077016 commit c70f884
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/cz/zipek/sqflint/linter/Linter.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ public int start() throws IOException {
} else {
getErrors().add((SQFParseException)e);
}
} catch (TokenMgrError e) {
getErrors().add(new SQFParseException(e));
} finally {
postParse();

Expand Down
8 changes: 8 additions & 0 deletions src/cz/zipek/sqflint/linter/SQFParseException.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import cz.zipek.sqflint.parser.ParseException;
import cz.zipek.sqflint.parser.Token;
import cz.zipek.sqflint.parser.TokenMgrError;

/**
*
Expand All @@ -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;
}
Expand Down

0 comments on commit c70f884

Please sign in to comment.