From f03bb3c932b035a94222cdd57b60ba1c77130585 Mon Sep 17 00:00:00 2001 From: zaaarf Date: Sat, 26 Aug 2023 18:25:31 +0200 Subject: feat: added error handling and generally tweaked tsrg parsing --- .../ftbsc/lll/exceptions/MalformedMappingsException.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/main/java/ftbsc/lll/exceptions/MalformedMappingsException.java') diff --git a/src/main/java/ftbsc/lll/exceptions/MalformedMappingsException.java b/src/main/java/ftbsc/lll/exceptions/MalformedMappingsException.java index 1352855..17bb3b5 100644 --- a/src/main/java/ftbsc/lll/exceptions/MalformedMappingsException.java +++ b/src/main/java/ftbsc/lll/exceptions/MalformedMappingsException.java @@ -1,7 +1,17 @@ package ftbsc.lll.exceptions; +/** + * Thrown when something goes wrong while parsing a mappings file. + */ public class MalformedMappingsException extends Exception { - public MalformedMappingsException(String mapping, String type) { - super(String.format("Unexpected token at line %s for mapper type %s!", mapping, type)); + + /** + * Constructs a new {@link MalformedMappingsException} given the line number + * and an error message. + * @param lineNumber the line the error occurred at + * @param error the error message + */ + public MalformedMappingsException(int lineNumber, String error) { + super(String.format("Unexpected token at line %d: %s!", lineNumber, error)); } } -- cgit v1.2.3-56-ga3b1