diff options
| author | 2018-07-10 17:17:55 +0800 | |
|---|---|---|
| committer | 2018-07-10 17:29:04 +0800 | |
| commit | d980311d214c3e1e0234eb011d5ced6701ce3a5a (patch) | |
| tree | 31d28744416472094384efcccb58b871b9e31d3c /src/main/java/cuchaz/enigma/throwables/MappingParseException.java | |
| parent | Merge pull request #6 from thiakil/speedy-getsources (diff) | |
| download | enigma-fork-d980311d214c3e1e0234eb011d5ced6701ce3a5a.tar.gz enigma-fork-d980311d214c3e1e0234eb011d5ced6701ce3a5a.tar.xz enigma-fork-d980311d214c3e1e0234eb011d5ced6701ce3a5a.zip | |
Allow reader/writer subclasses to provide the underlying file operations
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 cc5f650..b7e6d42 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; |