aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/shcm/shsupercm/fabric/citresewn/ex/CITParsingException.java
blob: 811d16bb24ae78ba979b9848ddbc5cfd753455fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package shcm.shsupercm.fabric.citresewn.ex;

import shcm.shsupercm.fabric.citresewn.pack.format.PropertyGroup;

public class CITParsingException extends Exception {
    public CITParsingException(String message, PropertyGroup propertyGroup, int position, Throwable throwable) {
        super("Errored while parsing CIT: " + descriptionOf(message, propertyGroup, position), throwable);
    }

    public CITParsingException(String message, PropertyGroup propertyGroup, int position) {
        super("Errored while parsing CIT: " + descriptionOf(message, propertyGroup, position));
    }

    public static String descriptionOf(String message, PropertyGroup propertyGroup, int position) {
        return message + (position != -1 ? " @L" + position : "") + " in " + propertyGroup.identifier.toString() + " from " + propertyGroup.packName;
    }
}