Search in sources :

Example 1 with SyntaxError

use of org.graylog.plugins.pipelineprocessor.parser.errors.SyntaxError in project graylog2-server by Graylog2.

the class UnaryExpression method requireNonNull.

private static Expression requireNonNull(Expression expression, Token token) {
    if (expression != null) {
        return expression;
    } else {
        final int line = token.getLine();
        final int positionInLine = token.getCharPositionInLine();
        final String msg = "Invalid expression (line: " + line + ", column: " + positionInLine + ")";
        final SyntaxError syntaxError = new SyntaxError(token.getText(), line, positionInLine, msg, null);
        throw new ParseException(Collections.singleton(syntaxError));
    }
}
Also used : SyntaxError(org.graylog.plugins.pipelineprocessor.parser.errors.SyntaxError) ParseException(org.graylog.plugins.pipelineprocessor.parser.ParseException)

Aggregations

ParseException (org.graylog.plugins.pipelineprocessor.parser.ParseException)1 SyntaxError (org.graylog.plugins.pipelineprocessor.parser.errors.SyntaxError)1