diff options
Diffstat (limited to 'src/main/java/cuchaz/enigma/throwables/MappingParseException.java')
| -rw-r--r-- | src/main/java/cuchaz/enigma/throwables/MappingParseException.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/cuchaz/enigma/throwables/MappingParseException.java b/src/main/java/cuchaz/enigma/throwables/MappingParseException.java index cc5f650a..b7e6d426 100644 --- a/src/main/java/cuchaz/enigma/throwables/MappingParseException.java +++ b/src/main/java/cuchaz/enigma/throwables/MappingParseException.java | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | package cuchaz.enigma.throwables; | 12 | package cuchaz.enigma.throwables; |
| 13 | 13 | ||
| 14 | import java.io.File; | 14 | import java.io.File; |
| 15 | import java.util.function.Supplier; | ||
| 15 | 16 | ||
| 16 | public class MappingParseException extends Exception { | 17 | public class MappingParseException extends Exception { |
| 17 | 18 | ||
| @@ -25,6 +26,12 @@ public class MappingParseException extends Exception { | |||
| 25 | filePath = file.getAbsolutePath(); | 26 | filePath = file.getAbsolutePath(); |
| 26 | } | 27 | } |
| 27 | 28 | ||
| 29 | public MappingParseException(Supplier<String> filenameProvider, int line, String message) { | ||
| 30 | this.line = line; | ||
| 31 | this.message = message; | ||
| 32 | filePath = filenameProvider.get(); | ||
| 33 | } | ||
| 34 | |||
| 28 | @Override | 35 | @Override |
| 29 | public String getMessage() { | 36 | public String getMessage() { |
| 30 | return "Line " + line + ": " + message + " in file " + filePath; | 37 | return "Line " + line + ": " + message + " in file " + filePath; |