package error;

import static java.text.MessageFormat.format;

import file.FilePosition;

public abstract class LineColumnException extends LispException {

    private static final long serialVersionUID = 1L;
    private FilePosition position;

    public LineColumnException(FilePosition position) {
        this.position = position;
    }

    @Override
    public String getMessage() {
        return format("{0} - line {1}, column {2}", getMessagePrefix(), position.getLineNumber(),
                      position.getColumnNumber());
    }

    public abstract String getMessagePrefix();

}