summaryrefslogtreecommitdiff
path: root/src/main/java/ftbsc/lll/exceptions/MappingNotFoundException.java
diff options
context:
space:
mode:
author zaaarf <zaaarf@proton.me>2023-03-18 17:24:43 +0100
committer zaaarf <zaaarf@proton.me>2023-03-18 17:24:43 +0100
commit344e66061b31a83f7ace2ab887e80f782f560297 (patch)
treeb8841cdf15a97376cc75206818a989b0e1918e36 /src/main/java/ftbsc/lll/exceptions/MappingNotFoundException.java
parent8695612c58141b1d5e0ee274027ebbd2050de6f8 (diff)
parent909f5cfa07464f35814da1686b0ac1a6c3ea03dd (diff)
Merge branch 'version3' into dev
Diffstat (limited to 'src/main/java/ftbsc/lll/exceptions/MappingNotFoundException.java')
-rw-r--r--src/main/java/ftbsc/lll/exceptions/MappingNotFoundException.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/main/java/ftbsc/lll/exceptions/MappingNotFoundException.java b/src/main/java/ftbsc/lll/exceptions/MappingNotFoundException.java
new file mode 100644
index 0000000..e943c01
--- /dev/null
+++ b/src/main/java/ftbsc/lll/exceptions/MappingNotFoundException.java
@@ -0,0 +1,27 @@
+package ftbsc.lll.exceptions;
+
+import ftbsc.lll.processor.tools.obfuscation.ObfuscationMapper;
+
+/**
+ * Thrown upon failure to find the requested mapping within a loaded {@link ObfuscationMapper}.
+ */
+public class MappingNotFoundException extends RuntimeException {
+
+ /**
+ * Constructs a new mapping not found exception for the specified mapping.
+ * @param mapping the relevant mapping
+ */
+ public MappingNotFoundException(String mapping) {
+ super(String.format("Could not find mapping for %s!", mapping));
+ }
+
+ /**
+ * Constructs a new mapping not found exception for the specified mapping
+ * with the specified reason.
+ * @param mapping the relevant mapping
+ * @param reason the reason message
+ */
+ public MappingNotFoundException(String mapping, String reason) {
+ this(mapping + ": " + reason);
+ }
+}