All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gherkin.parser.ParseError Maven / Gradle / Ivy

There is a newer version: 2.12.2
Show newest version
package gherkin.parser;

import gherkin.util.FixJava;

import java.util.List;

public class ParseError extends RuntimeException {
    private final String state;
    private final List legalEvents;

    public ParseError(String state, String event, List legalEvents, String uri, Integer line) {
        super("Parse error at " + uri + ":" + line + ". Found " + event + " when expecting one of: " + FixJava.join(legalEvents, ", ") + ". (Current getState: " + state + ").");
        this.state = state;
        this.legalEvents = legalEvents;
    }

    public List getLegalEvents() {
        return legalEvents;
    }

    public String getState() {
        return state;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy