Skip to content

Commit

Permalink
add error handling to stats query parser antlr (#1429)
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Sebastian <[email protected]>
(cherry picked from commit 50fe732)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Feb 13, 2024
1 parent 5381cac commit 0121eca
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion common/query_manager/query_parser/ppl_query_parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ export class PPLQueryParser {

getStats() {
this.visitor = new StatsAstBuilder();
return this.visitor.visitRoot(this.parser!.root()).getTokens();
let inter = null;
try {
inter = this.visitor.visitRoot(this.parser!.root()).getTokens();
} catch (e) {
console.error(e);

Check warning on line 27 in common/query_manager/query_parser/ppl_query_parser.ts

View check run for this annotation

Codecov / codecov/patch

common/query_manager/query_parser/ppl_query_parser.ts#L27

Added line #L27 was not covered by tests
}
return inter;
}
}

0 comments on commit 0121eca

Please sign in to comment.